Let \(f\) be analytic in a region \(D\) and \(\gamma\) a rectifiable curve in \(D\) with interior in \(D\).
Prove that if \(f(z)\) is real for all \(z\in \gamma\), then \(f\) is constant.
Solution
Let \(\Omega\) be an interior component bounded by \(\gamma\). Since \(f\) is analytic on a neighborhood of \(\overline\Omega\), its imaginary part \[ v(z)=\operatorname{Im}f(z) \] is harmonic on \(\Omega\) and continuous on \(\overline\Omega\).
By hypothesis, \(f\) is real-valued on \(\gamma\), so \[ v=0 \] on \(\partial\Omega\). The maximum and minimum principles for harmonic functions therefore give \[ v\equiv0 \] on \(\Omega\). Hence \[ f(\Omega)\subset\mathbb R. \]
If \(f\) were nonconstant on \(\Omega\), the open mapping theorem would imply that \(f(\Omega)\) is open in \(\mathbb C\), which is impossible because \(\mathbb R\) has empty interior in \(\mathbb C\). Thus \(f\) is constant on the nonempty open set \(\Omega\).
Finally, \(D\) is connected and \(f\) is analytic on \(D\), so the identity theorem implies that \(f\) is constant on all of \(D\).