Holomorphicity of the square of a function

Pick any discontinuous $f : \Bbb C \to \{-1;1\}$.

$f^2$ is constant, hence holomorphic, but $f$ clearly isn't.


Take $f(z)$ such that, if $z=\rho(\cos\theta+i\sin\theta)$, with $\theta\in[0,2\pi)$, then $f(z)=\sqrt\rho\left(\cos\frac\theta2+i\sin\frac\theta2\right)$. Then $f$ isn't holomorphic (it isn't even continuous), but $\forall z\in\mathbb{C}:f^2(z)=z$.


If $f^{2}$ is holomorphic $f$ need not be. You can choose a particular branch $\sqrt z$ to get a counter-example. For example, on $\Omega =\mathbb C \setminus {0}$ you can define $\sqrt {re^{i\theta }}$ as $\sqrt r e^{i\theta /2\}}$ when $\theta$ is chosen in $[0,2\pi)$. This gives you a single valued function whose square is holomorphic but the function itself is not. However, if $f$ is continuous and $f^{2}$ is holomorphic then so is $f$.