If $f$ is a complex polynomial such that $f(z) \in \mathbb{R}$ whenever $|z| = 1$, then $f$ is constant.
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.