Let $f \in O(D)$ for some domain $D$. Prove that if $|f(z)|$ is a constant, then $f(z) =$ const on $D$.
It seems to me it is the direct application of the following version of maximum modulus principle:
Let f be a function holomorphic on some connected open subset $D$ of the complex plane $\mathbb{C}$ and taking complex values. If $z_0$ is a point in $D$ such that
$|f(z_0)|\ge |f(z)|$ for all z in a neighborhood of $z_0$, then the function f is constant on D.