# Show with maximum principle: $|f|$ constant, f analytic, then $f$ constant in open domain $D$

Let $f=u+iv$ be analytic in an open domain $D$.
If $|f|$ is constant in $D$, show, with the maximum principle, that $f$ is constant on $D$.

The proof through Cauchy-Riemann is here.
There it is mentioned that the result can be shown with the maximum principle.
I don't see how the proof goes.
From the maximum principle, I can write $$k = u^2+v^2 \le \left| f\left( z \right) \right|,$$ for $z$ in the boundary, and $k=|f|$ on $D$.

-
It seems to follow directly from the theorem presented on wikipedia en.wikipedia.org/wiki/Maximum_modulus_principle Note the $\geq$ sign – user45150 Feb 9 '13 at 2:00
@user45150 Very true, thanks. – Nicolas Essis-Breton Feb 9 '13 at 2:03
You can see this more directly with the open (or local) mapping theorem. Assuming $f$ is nonconstant, it takes a neighborhood to a neighborhood. But $|w| = C$ for a constant $C$ is a circle and isn't open in $\mathbb{C}$, hence $f$ must be constant. Of course, the maximum modulus principle follows as well from this line of reasoning. – A Blumenthal Feb 9 '13 at 5:34