Proof that, if $f$ and $|f|$ are analytic, then $f$ is constant I am trying to show that assuming for an analytic $f$ we have $|f|$ is also analytic. That the original f must be constant.
My original thought was to use the Cauchy Riemann equations to try and show that the partial derivatives are equal to their negatives. I am unsure how to carry this out however, as I am struggling to express the partial derivatives of $|f|$ in terms of the partial derivatives of $f$.
Could someone please let me know if I'm on the right track, or else give me a nudge in the correct direction.
Thanks in advance
 A: If $f$ and $|f|$ are both analytic (in the whole complex plane $\mathbb C$),  $g:=\frac{f}{1+|f|}$ is analytic in the whole complex plane and $|g|< 1$. So $g$ is constant $f=c(1+|f|)$ and, in particular, $|f|=|c|(1+|f|)=|c|+|c||f|$ and $|f|=\frac{|c|}{1-|c|}$ and you have that $|f|$ is constant. Then, using that $f=c(1+|f|)$, you'll get that $f=c\left(1+\frac{|c|}{1-|c|}\right)$ which is a constant.
A: $|f|=|u+iv|=\sqrt{u^2+v^2}$ is analytic, $u=u(x,y), v=v(x,y)$.
$\implies |f|=U+iV; U=\sqrt{u^2+v^2}, V=0$
$U_x=V_y\implies uu_x+vv_x=0$
$U_y=-V_x\implies uu_y+vv_y=0$
From the analyticity of $f$, we have $u_x=v_y, u_y=-v_x;$
$\implies uu_x-vu_y=0$
$\implies uu_y+vu_x=0$
$\implies (u^2+v^2)u_y=(u^2+v^2)u_x=0$
For non-trivial solution, $u^2+v^2\neq0$
$\implies u_x=u_y=v_x=v_y=0$
A: Assume $f,|f|$ are analytic in the connected open set $U.$ If $f\equiv 0,$ we're done. Otherwise, using continuity, there is a disc $D(a,r)\subset U$ where $f$ is nonzero. Now $|f|$ analytic implies $|f|^2= f\bar f$ is analytic. Thus in $D(a,r),$ $(f\bar f)/f = \bar f$ is analytic. Now use the CR equations (this is easy) to see $f$ must be constant in $D(a,r),$ hence constant in $U$ by the identity principle.
