How does gm get that value in the following question?
The transconductance \$g_m\$ is given by
$$
g_{m} = \frac{2 I_D}{V_{GS}-V_T}
$$
The drain voltage \$V_D =2V \$ and for DC there is no voltage drop across \$R_G\$. Therefore \$V_{GS} = V_D\$ and
$$
g_{m} = \frac{2 I_D}{V_{GS}-V_T} = \frac{1 mA}{2V - 0.9V}
$$
When the current through the transistor is doubled the gate-source voltage will increase by \$\sqrt2\$. Using this value the resulting \$g_m\$ can be calculated in the same way as before.