Step 1: Identify which pairs of charges are a side apart and which are a diagonal apart.
Call the square's side $x$. From the figure, $-q$ and $+q$ sit at adjacent corners (a distance $x$ apart), and $+q$ and $Q$ also sit at adjacent corners (distance $x$), which leaves $-q$ and $Q$ sitting diagonally opposite, a distance $\sqrt2\,x$ apart.
Step 2: Write the total potential energy of the three charges.
\[
U = k\left[\frac{(-q)(q)}{x} + \frac{(q)(Q)}{x} + \frac{(-q)(Q)}{\sqrt2\,x}\right]
\]
Step 3: Set $U=0$ and cancel the common factor $k/x$.
\[
-q + Q - \frac{Q}{\sqrt2} = 0 \implies Q\left(1-\frac{1}{\sqrt2}\right) = q
\]
Step 4: Solve for $Q$ and rationalise the denominator.
\[
Q = \frac{q}{1-\tfrac{1}{\sqrt2}} = \frac{q\sqrt2}{\sqrt2-1} = \frac{q\sqrt2(\sqrt2+1)}{(\sqrt2-1)(\sqrt2+1)} = q(2+\sqrt2)
\]
Step 5: Match this to the option's form.
Multiplying $\dfrac{2}{2-\sqrt2}$ by $\dfrac{2+\sqrt2}{2+\sqrt2}$ gives $\dfrac{2(2+\sqrt2)}{2} = 2+\sqrt2$, so
\[
q(2+\sqrt2) = \frac{2q}{2-\sqrt2}
\]
\[
\boxed{Q = \frac{2q}{2-\sqrt2}}
\]