# Holomorphicity of the square of a function

I am trying to figure out whether the following statement is true.

If $f$ is such that $f^2$ is holomorphic on an open set $\Omega \subset \mathbb{C}$ then $f$ itself is holomorphic on $\Omega$.

My feeling would be that since the function mapping $z$ to $\sqrt{z}$ is multivalued that this should not be the case, but I am struggling to come up with a counterexample.

• A subtly different question (for which the 3 answers I see now do not provide a counterexample) is: if $g$ is holomorphic on $\Omega$, can one find a holomorphic $f$ such that $f^2=g$? – Federico Poloni Apr 29 '18 at 14:23
• @FedericoPoloni that's a much harder question, often attacked via algebraic topology! In a simple case, if $\Omega$ is simply connected than $f$ has a primitive. It's easy to prove that if $f$ is nowhere zero then $f = e^g$ for some $g$, so $f = (e^{g/n})^n$. Of course, this is only scratching the surface, since $z^2$ is clearly sometimes zero! – Brevan Ellefsen Apr 29 '18 at 16:17

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$.