This is related to what Gunnar Magnusson said above. First suppose $|w| = 1$. Then $u = \cos(\theta)$ and $v = \sin(\theta)$ for some $\theta \in (-\pi,\pi]$, so that $w = e^{i\theta}$. Then $a = ({1 + \cos(\theta) \over 2})^{1 \over 2}$ and $b = ({1 - \cos(\theta) \over 2})^{1 \over 2}$. By the half-angle formulas, $a = \cos{\theta \over 2}$. Also, $ b= \sin{\theta \over 2}$ when $v \geq 0$, while $b =
-\sin{\theta \over 2}$ when $v < 0$.
So if $v \geq 0$, $z = a + ib = \cos{\theta \over 2}+ i\sin{\theta \over 2} = e^{i{\theta \over 2}}$, while if $v < 0$, $\bar{z} = a - ib = \cos{\theta \over 2}+ i\sin{\theta \over 2} = e^{i{\theta \over 2}}$. Thus in the first case, $z^2 = w$, while in the second case $(\bar{z})^2 = w$. This is what you want.
If $|w| \neq 1$, the above proves it for ${w \over |w|}$ in place of $w$. Multiplying everything through by $|w|$ then gives your result.