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?