Analytic continuation via square of absolute value Is the following fact true (I think that I can prove it but I don't trust
myself on these matters): let $f(z)$ be an analytic function defined on
some open subset $U$ of ${\mathbb C}$. Assume that the function
$|f(z)|^2$ extends as a real-analytic function to some bigger simply connected open
subset $V$ of ${\mathbb C}$. Then $f$ extends analytically to $V$.
Is there a reference for this fact?
 A: Rather obviously not: if $f(z)=\sqrt{z}$ on $U$, the
plane slit along the negative real axis, then $|f(z)|^2=|z|$
is real analytic on $V$ the plane with the origin removed
but $f$ does not analytically continue from $U$ to $V$.
A: Trivially not. Let $\psi$ be a smooth function on $\mathbb{R}$ such that $\psi(x) = 0$ if $x < 1$ and $\psi(x) = 1$ if $x > 2$ and $\psi(x)$ monotonic. 
Let $f(z) = e^{i\psi(|z|)}$. $f(z)$ is complex analytic in the unit disk, $|f(z)|^2 = 1$ is real analytic on the entire plane, but $f(z)$ is not analytic on any open sets strictly containing the unit disk. 
(I defined $\psi$ just so that you see even if you upgrade some a priori assumption on the regularity of $f$, it is not enough. Otherwise you can just take $f$ to equal 1 in the unit disk and -1 outside and get a discontinuous counterexample.)
A: This needs some details.  For example, what about points with $f(z) = 0$? 
Assume $|f(z)|^2$ is real analytic in a larger domain.  Then $u(z) = \log |f(z)|$ is real analytic.  It is harmonic in the original domain, so (?) deduce it is harmonic in the larger domain.
Construct a harmonic conjugate $v(z)$ so that $g(z) = u(z)+iv(z)$ is analytic, using simple connectivity.  And then your extension is $exp(g(z))$.  
On the other hand, if (?) doesn't work, it shows how to do a counterexample...
