Solution (source code)

= Solution
{c}

On the slit <domain> $D$, choose the <complex argument> $\theta=\operatorname{Arg}_{(0,2\pi)}z$. The resulting <holomorphic logarithm> is $L(z)=\log|z|+i\theta$, with $L'(z)=1/z$. Define
$$
\boxed{f(z)=\exp\bigl(\tfrac12L(z)\bigr)=\sqrt{|z|}\,e^{i\theta/2}.}
$$
It is <holomorphic> as a composition of <holomorphic functions>, and $f(z)^2=e^{L(z)}=z$. At $z=-1$ the chosen <argument> is $\pi$, so $f(-1)=i$.

Suppose a <holomorphic square root> $g$ existed on the whole <punctured complex plane>. It would be nonzero, and differentiating $g^2=z$ would give $2gg'=1$. There are several ways to express the resulting obstruction; a direct one uses the <unit circle>. Set
$$
q(t)=e^{-it/2}g(e^{it}),\qquad 0\leq t\leq2\pi.
$$
The <chain rule> and $g'(z)=g(z)/(2z)$ imply $q'(t)=0$, so $q$ is constant. But
$$
q(0)=g(1),\qquad q(2\pi)=-g(1).
$$
These cannot agree because $g(1)^2=1$. Thus no such global <holomorphic square root> exists. Going once around zero changes the sign of the locally chosen root.