Show constant function. There are two parts to this question:
(a) Let $U \subseteq \mathbb{C}$ be a connected open set containing the closed unit disk $\overline{B(0,1)}$. Let $f \in \mathcal{O}(U)$ be a holomorphic function such that for any $z \in U$ with $|z|=1$, we have $f(z) \in \mathbb{R}$. 
Show that $f$ is a constant.
(b) Find a non-constant holomorphic function $f$ on $\mathbb{C} \setminus \{1\}$ such that for any $z \in \mathbb{C} \setminus \{1\}$ with $|z|=1$, we have $f(z) \in \mathbb{R}$.
I am guessing this question might need maximum modulus theorem, or maybe harmonic functions since real-valued functions come into play? Thank you for any help!
 A: For (a):
Let $D=\Bbb{B}(0,1)$
You know that if $f=u+iv$, then $u$ and $v$ are harmonic. Now, by assumption you have that $v$ is zero on the boundary of the disk$D$. But, by the two extrema principles, you know that the maximum and minimum of $v$ occur on the boundary of your disc, and so clearly this implies that $v$ is identically zero. Thus, $f=u$, and so $f$ maps the disk $\overline{D}$ into $\mathbb{R}$
Then  since $\overline{D}$ is compact and path connected and  $f$ is continuous,we have  $f(\overline{D})$is compact path connected subset of $\mathbb R$
So either $f(\overline{D})$ is closed interval or singleton set in $\mathbb R$.
So if, $f(\overline{D})=[a,b]$ 
But then note that $\overline{D}- \{0\}$ (or any poin in $D$,if $0$ doesn't work) is path connected but image of continues $f$ is not.
So $f(\overline{D})$ is singleton set.
So $f$ must be constant on  $\overline{D}$.  Say, $f(z)=r $ $\forall z \in D$.
By , Identity theorem ,we have $f(z)=r$ for all $ z\in U$.
Edit:
I did mistake here ,
We can't say that, $f(\overline{D}- \{0\})=[a,c) \cup (c,b].$
Instead, let $g(z)=f(z)-c$ and $S=\{z \in D | g(z)=0\}$,
Then we know ,if $g$ is non-constant then $S$ must be atmost countable and should not contain any limit point, (because zeros of non-constant analytic functions are isolated)
Then , $f(\overline{D}- S)=[a,c) \cup (c,b].$
And $ \overline{D}- S$ is path connected,because $S$ is atmost countable.
A: Answer for a): Apply the following to $e^{if(z)}$: If a holomorphic function $f$ has modulus $1$ on the unit circle, why does $f(z_0)=0$ for some $z_0$ in the disk?
For (b): Let $f(z)=i\frac  {1+z} {1-z}$. Note that the imaginary part of $f(z)$ is the real part of $\frac  {1+z} {1-z}=\frac {(1+z)(1-\overline{z})} {|1-z|^{2}}$ which is $0$ when $|z|=1, z \neq 1$.
