How could one argue using the Maximum Modulus Principle that if a function $f$ is holomorphic on a connected open set $U \subset \mathbb{C}$ such that Im$f$ has a local maximum in $U$, then $f$ must be constant?
Clearly, if Im$f$ has a local minimum, Im$(1/f)$ has a local maximum. Moreover, $f$ is locally constant at a point $z_0$ if there exists an open set $U$ such that $z_0 \in U$ and $f$ is constant on $U$.
Define $g$ on $U$ as $g(z) = e^{-if(z)}$. Then $|g(z)| = e^{\operatorname{Im} f(z)}$, so that the Maximum Modulus Principle can be applied to $g$. It follows that $g$ is constant and since $$ 0 = g'(z) = -if'(z) e^{-if(z)} \,, $$ $f$ is constant as well.
Alternatively one can apply the "maximum modulus principle for harmonic functions" to $\operatorname{Im} f(z)$.
Or, if $\operatorname{Im} f(z)$ has a maximum at $z_0$ in $V \subset U$ then $f(V)$ does not contain an open neighbourhood of $f(z_0)$, i.e. $f$ is not not an open mapping.