Step 1: Write Graham's law in terms of mass diffused.
Since moles diffusing per unit time is $n/t = w/(Mt)$ and rate is inversely proportional to $\sqrt{M}$, for the same diffusion time we get \[ \dfrac{w_1/M_1}{w_2/M_2} = \sqrt{\dfrac{M_2}{M_1}} \]
Step 2: Insert the molar masses.
Here $w_1 = 3$ g and $M_1 = 32$ for $\text{O}_2$, while $M_2 = 64$ for $\text{SO}_2$.
Step 3: Solve for $w_2$.
\[ \dfrac{3/32}{w_2/64} = \sqrt{2} \implies \dfrac{6}{w_2} = \sqrt{2} \implies w_2 = \dfrac{6}{\sqrt{2}} \] Rationalising, $w_2 = \dfrac{6\sqrt{2}}{2} = 3\sqrt{2}$.
\[ \boxed{w_2 = \sqrt{2}\times 3 \text{ g}} \]