Suppose $\bar{D}= \{z:|z|\leq 1\}$ and assume we have a non-constant, continuous function $f:\bar{D}\rightarrow \bar{D}$, that is holomorphic on the interior of $\bar{D}$ and such that $f(\partial D)\subset \partial D$.
Show that $f(\partial D)=\partial D$.
Since $f$ is non-constant on $\bar{D}$, it is also non-constant on $\partial D$, because $\partial D$ is the closure of $\bar{D}$ and I think I have to use the fact that $|f|$ attains the max or min on the boundary $\partial D$. Could someone please help me to understand how to do that?
Hint. Let $\mathcal{B}$ be the set of non-constant, continuous functions $f:\bar{D}\rightarrow \bar{D}$, holomorphic in $D$ and such that $f(\partial D)\subset \partial D$ where $D=\{z: |z|<1\}$.
1) If $f\in \mathcal{B}$ then $0\in f(D)$.
If not $1/f\in \mathcal{B}$ and $1/|f|$ has a maximum in $\partial D$, which is a minimum for $|f|$. Therefore $|f|$ has a minimum AND a maximum in $\partial D$ where $|f|=1$. Hence $|f|=1$ in $\bar D$, which implies that $f$ is constant. Contradiction.
2) If $f\in \mathcal{B}$ then $f(D)=D$.
If not there is $a \in D$ such that $a\not \in f(D)$. Hence $M_a \circ f$ is never $0$ in $D$, where $M_a={{z-a} \over {1- \overline a z}}$. Since $M_a \circ f\in\mathcal{B}$ , by 1), we get a contradiction.
P.S. More generally, by Fatou's Theorem (see Theorem A), $f\in\mathcal{B}$ is a finite Blaschke product: $$f(z) = e^{i \theta} \prod_{k=1}^{n} {{z-a_k} \over {1- \overline a_kz}}$$ where, $n\in\mathbb{N}^+$, $\theta\in\mathbb{R}$, and $a_k \in D$ for $k=1,\dots,n$.