Prove that if $f(z)$ is analytic and $g(z)=\left|f(z) \right|^2 + f(z)$ is also analytic then $f(z)$ is constant The only approach that I came up with was trying to prove that if $h(z)=g(z) - f(z) =\left|f(z) \right|^2$, then the range of $h(z)$ only takes real values which implies that by using the Cauchy-Riemann equations, the partial derivatives are $0$ and hence $h(z)$ is constant.
However, is it true that if $h(z)$ is constant, then $f(z)$ is also constant?
 A: The statement is equivalent to showing that if $f(z)$ is analytic and $|f(z)|^2$ is analytic, then $f(z)$ is constant. 
But in open regions where $f(z)$ is nonzero (which exist) we must have $\overline{f(z)} = |f(z)|^2/f(z)$ analytic.
However the function $\bar{f}+f$ is analytic and so is $f-\bar{f}$...
... and so you can conclude that the real and imaginary parts of $f$ are constant on the open set where $f \neq 0$. Using the continuity of $f$ we can conclude it is constant everywhere.
A: You were right to conclude that $|f|^2$ is constant, and you can deduce from this and the analyticity of $f$ that $f$ is constant. If $f = u + iv$, then $u^2 + v^2 = |f|^2 = c$, for some constant $c$. If $c = 0$, then $f = 0$. So assume $c\neq 0$. Differentiation with respect to $x$ and $y$ gives $uu_x + vv_x = 0$ and $uu_y + vv_y = 0$. Since $u_x = v_y$ and $u_y = -v_x$, the latter equation becomes $-uv_x + vu_x = 0$. Thus $$0 = (uu_x + vv_x)^2 + (-uv_x + vu_x)^2 = u^2(u_x^2 + v_x^2) + v^2(v_x^2 + u_x^2) = (u^2 + v^2)(u_x^2 + v_x^2).$$ Since $u^2 + v^2$ is the nonzero constant $c$, we deduce that $u_x^2 + v_x^2 = 0$, which forces $u_x = v_x = 0$. Thus $u_y = -v_x = 0$ and $v_y = u_x = 0$. Therefore, $u$ and $v$ are constant $\implies$ $f$ is constant.
A: If $|f|^2$ is analytic, then it is either constant or an open map. The latter is excluded because $|f|^2$ maps to the real line. With $|f|^2$ also $|f|$ is constant. Hence $f$ maps to a circle. The same argument from analyticity of $f$ shows that $f$ is constant, q.e.d.
