Analytic function on unit disk has finitely many zeros I am studying complex analysis from Theodore Gamelin's text and Exercise 1 of chapter IX.2 says that if $f$ is analytic inside the open unit disk and continuous on its boundary that satisfies $|f(z)| = 1$ for $|z| = 1$, then $f$ is a finite Blaschke product. Clearly, this would imply that $f$ has only finitely many zeros in the open unit disk. 
But the proof of it already assumes this fact. 
So my question is that is it trivial that such an $f$ has finitely many zeros in the open unit disk?
 A: Let $\mathbb{D}$ denote the open unit disc. In general, an analytic function $f:\mathbb{D}\to\mathbb{C}$ is allowed to have countably many zeros in $\mathbb{D}$. As Friedrich has pointed out,
$$
\sin\left(\frac{1}{1+z}\right)
$$
is an example of a function that is analytic on $\mathbb{D}$ and has infinitely zeros inside $\mathbb{D}$.
However, if we assume that $f$ is continuous on $\mathbb{D}$, and also that $|f(z)| = 1$ for $|z|=1$, then the story changes. Suppose $f$ has countably many zeros $z_n$ in $\mathbb{D}$. Then by compactness, the set $\{z_n\}$ has a limit point in $\overline{\mathbb{D}}$. 
The zeros cannot have a limit point on boundary of the unit disc, since if $z_{n_k}\to z_\infty\in\partial\mathbb{D}$ then $f(z_{n_k})\to f(z_\infty)$ by continuity, but $|f(z_{n_k})| = 0$ and $|f(z_\infty)| = 1$, contradiction. 
So the limit point in $\mathbb{\overline{\mathbb{D}}}$ must lie inside $\mathbb{D}$. But then $f$ has a sequence of zeros converging inside its domain of definition, and since $f$ is analytic it follows that $f \equiv 0$. This is a contradiction if $f$ is assumed nontrivial.
Therefore it follows that if $f$ is nontrivial, then $f$ can only have finitely many zeros inside $\mathbb{D}$. At this point one can express $f$ as a product of finitely many Blaschke factors using a consequence of the Schwarz lemma.
