Why: A holomorphic function with constant magnitude must be constant.

How can I prove the following assertion?

Let $f$ be a holomorphic function such that $|f|$ is a constant. Then $f$ is constant.

Edit: The more elementary the proof, the better. I'm working my way through a complex analysis workbook, and by this exercise, the only substantial thing covered has been the Cauchy-Riemann equations.


If $|f|$ is constant, then the image of $f$ is a subset of a circle in $\mathbb{C}$. Apply the Open Mapping Theorem.


Let $f(z) = u(x,y) + iv(x,y)$, where $u(x,y),v(x,y) \in \mathbb{R}$. We then have that $$\lvert f \rvert^2 = u(x,y)^2 + v(x,y)^2 = \text{constant}$$ Hence, $$\frac{\partial (u^2 + v^2) }{\partial x} = 0 = \frac{\partial (u^2 + v^2) }{\partial y}$$ This implies $$u \frac{\partial u}{\partial x} + v \frac{\partial v}{\partial x} = 0 = u \frac{\partial u}{\partial y} + v \frac{\partial v}{\partial y}$$ Making use of the Cauchy-Riemann equations, we get $$u \frac{\partial v}{\partial y} + v \frac{\partial v}{\partial x} = 0 = -u \frac{\partial v}{\partial x} + v \frac{\partial v}{\partial y}$$ Multiply the left equation by $u$ and the right equation by $v$ and add them up to get $$(u^2 + v^2) \frac{\partial v}{\partial y} = 0$$ If $u^2+v^2 = 0$, then $f=0$ throughout the domain since $\lvert f \rvert = \text{constant}$. If $u^2+v^2 \neq 0$, then $\dfrac{\partial v}{\partial y}=0$ which also gives us $\dfrac{\partial v}{\partial x}=0$. Now by Cauchy-Riemann, we also get that $\dfrac{\partial u}{\partial x}=\dfrac{\partial u}{\partial y}=0$. Hence, $f'(z) = 0$ which gives us that $f$ is constant.

Also if $f(z)$ happens to be entire, then the conclusion immediately follows from Liouville's theorem.