Let $\Omega \subset \mathbb C$ be an open and connected set, such that $\overline{D_1} \subset \Omega$. Let $f:\Omega \to \mathbb C$ be a holomorphic function with $f(z) \in \mathbb R$ for all $z$ such that $|z|=1$. Show that $f$ is constant.
I couldn't do much of the problem. I've defined the function $e^{if(z)}$. So, for $z : |z|=1$, $e^{if(z)} \in \partial D_1$. I don't know if this is of any help. I would appreciate suggestions, maybe defining this function is not useful.
Addition from editing:
From what I've seen here Let $f(z)$ be entire function. Show that if $f(z)$ is real when $|z| = 1$, then $f(z)$ must be a constant function using Maximum Modulus theorem, using the maximum modulus principle, if $e^{if(z)}$ is non-constant on $D_1=\{|z|<1\}$, then $e^{if(z)}$ attains its maximum and minimum on $\partial D_1$. If we consider $e^{if}$ and $e^{-if}$, then $|e^{if(z)}|=1=|e^{-if(z)}|$ for all $z : |z|=1$. But then $$(1) \space |e^{if(z)}|\leq 1, |z|<1,$$ and $$(2) \space |e^{-if(z)}|\leq 1, |z|<1$$.
From (1) and (2) it follows $|e^{if(z)}|=1$ for all $z :\{|z|\leq 1\}$, which means $e^if$ is constant on $D_1 \implies f$ is constant on $D_1$.
I don't see how can I deduce from here that $f$ is constant on $\Omega$ just by the fact that $f$ is constant on $D_1$.