If a function $f$ is holomorphic on the closed unit disk centered at the origin and is real valued whenever $|z| = 1$, then $f$ is constant.

By the Schwarz reflection principle, the formula $f(z)=\overline{f(1/\overline{z})}$ for $|z|>1$ extends $f$ analytically to the entire complex plane. Then by definition of the extension, $f(\mathbb{C})\subset f(\overline{\mathbb{D}}) \cup \overline{f(\overline{\mathbb{D}})}$, which is bounded by compactness.


One can get this from the Schwarz Reflection Principle. That only works for the disk, or other special domains. It's easy to give an argument that works for any bounded domain:

The imaginary part is harmonic and vanishes on the boundary, so the imaginary part is $0$. So $f$ is real-valued. Hence $f$ is constant (Cauchy-Riemann equations, Open Mapping Theorem, who knows what else).

Or: Apply Maximum Modulus to $e^{if}$ and $e^{-if}$.