Suppose that $f$ is a non-constant holomorphic function on an open set containing $\overline{\Bbb{D}}$ such that $|f(z)| = 1$ for $z \in \partial \Bbb{D}$. (a) Prove that $f(\Bbb{D}) \subseteq \Bbb{D}$. (b) Then, using (a), prove the following: If $a_1,...,a_{k} \in \Bbb{D}$ are distinct zeros of $f$ and $$g(z) = \prod_{\ell = 1}^{k} (\phi_{\ell}(z))^{n_{\ell}},$$ where $n_{\ell}$ is the multiplicity of $a_{\ell}$, then prove that $f(z) = cg(z)$ for some constant $|c|=1$.
Note, $\phi_\ell$ is the automorphism of the unit disc $\Bbb{D}$ given by $$\phi_{\ell}(z) = \frac{a_\ell - z}{1 - \overline{a}_\ell z}$$For the second part, the hint I am given is to consider $f(z)/g(z)$ and $g(z)/f(z)$. Presumably, I am supposed to apply part (a) to these functions. I think I was able to figure out the first part (since $f$ is non-constant, the maximum modulus principle tells us that the maximum value of $|f|$ is attained on the boundary, so we have the strict inequality $|f(z)| < 1$ for all $z \in \Bbb{D}$), but I was unable to figure out the second part. Here is what I have for part (b)
(b): It isn't difficult to verify that if $z \in \partial \Bbb{D} = S^1$, then $|\phi_{\ell}(z)| = 1$ and hence $|g(z)| = 1$. Hence, $|f(z)| = |g(z)|$ for all $z \in \partial \Bbb{D}$. Clearly $f/g$ is constant if and only if $g/f$ is constant (on $\Bbb{D}$ (?) or $\overline{\Bbb{D}}$ (?)). Also, $a_{\ell}$ is a removable singularity of both $f/g$ and $g/f$ (why? I think this is true, but I am being a knucklehead so I don't presently see it), which means both are holomorphic on $\Bbb{D}$. Hence, if $f/g$ were non-constant, the maximum modulus principle would tell us $|f/g| < 1$ on $\Bbb{D}$ or $|f| < |g|$ on $\Bbb{D}$; similarly, $|g/f| < 1$ on $\Bbb{D}$ or $|g| < |f|$ on $\Bbb{D}$, which is a contradiction. Hence, $f/g$ is constant (on $\Bbb{D}$...? or $\Bbb{D}$?), so $f = cg$ for some $c \in \Bbb{C}$. But $|f| = 1$ on $\partial \Bbb{D}$, so $|c|=1$.
I'm sort of following two solutions I found, but I don't think the solutions are correct. Moreover, I don't see how the hint is helpful. If it's the case that $a_{\ell}$ is a removable singularity for each $\ell = 1,...,k$, then $|f(z)| < g(z)|$ for all $z \in \Bbb{D}$ should immediately give us a contradiction, so why do I need to consider both $f/g$ and $g/f$?
Both $f$ and $g$ are holomorphic in an open set $U \supset \overline{\Bbb{D}}$, and $f(z) = g(z) = 1$ for all $z \in \partial D$. Moreover, $f$ and $g$ have the same zeroes with the same multiplicities in $\Bbb D$.
The function $h = f/g$ is holomorphic in $U \setminus \{ a_1, \ldots, a_n \}$, with removable singularities at all $a_l$. Therefore $h$ can be homomorphically extended at all $a_l$, i.e. there exists a holomorphic function $H$ in $U$ with $H(z) = h(z)$ for all $z \in U \setminus \{ a_1, \ldots, a_n \}$. It follows that $f(z) = H(z) g(z)$ for all $z \in U$.
If $H$ is constant, then we are done: $f(z) = c g(z)$ with some constant $c$, and necessarily $|c| = 1$.
If $H$ is not constant the we can apply part (a) to the function $H$ and conclude that $H(\Bbb D) \subset \Bbb D$, so that $|f(z)| < |g(z)|$ for all $z \in \Bbb D$. But then we can repeat the above argument with $f$ and $g$ interchanged, and conclude that also $|g(z)| < |f(z)|$ for all $z \in \Bbb D$. Therefore this case can not occur.