Answer
(a) (i) $U = 4\times U_0$
(ii) $U = 0.25\times U_0$
(b) (i) The spring should be compressed $\sqrt{2}~x_0$.
(ii) The spring should be compressed $\frac{x_0}{\sqrt{2}}$.
Work Step by Step
$U_0 = \frac{1}{2}kx_0^2$
(a) (i) $U = \frac{1}{2}k(2~x_0)^2$
$U = 4\times \frac{1}{2}kx_0^2 = 4\times U_0$
(ii) $U = \frac{1}{2}k(\frac{x_0}{2})^2$
$U = \frac{1}{4}\times \frac{1}{2}kx_0^2 = 0.25\times U_0$
(b) (i) $2\times U_0 = 2\times \frac{1}{2}kx_0^2$
$2\times U_0 = \frac{1}{2}k(\sqrt{2}~x_0)^2$
The spring should be compressed $\sqrt{2}~x_0$.
(i) $\frac{1}{2}\times U_0 = \frac{1}{2}\times \frac{1}{2}kx_0^2$
$\frac{1}{2}\times U_0 = \frac{1}{2}k(\frac{x_0}{\sqrt{2}})^2$
The spring should be compressed $\frac{x_0}{\sqrt{2}}$.