# Proof of the Schwarz Lemma

I have a question which is (the Schwarz Lemma):

Suppose that $f:\mathbb{D}\rightarrow\mathbb{D}$ is holomorphic and suppose that $f(0)=0$, show that $\lvert f(z)\rvert \leq \lvert z \rvert \forall{z}\in\mathbb{D}$

and the solution is:

Let $g(z)=\frac{f(z)}{z}$ for $z\neq0$ and $g(0)=f'(0)$. Then g is holomorphic in $\mathbb{D}$.

Now apply the maximum principle to to g on the disc $\bar{D(0,r)}$ for $r<1$ to conclude that for $\lvert z \rvert \leq r$ we have $\lvert g(z) \rvert \leq\frac{1}{r}$ and then letting $r\rightarrow 1$ we get $\lvert g(z)\rvert\leq 1$ and so we get $\lvert f(z)\rvert \leq \lvert z \rvert$.

I am confused as to why $\lvert f(z) \rvert \leq 1$ for $z$ on the boundary of the disc.

$f$ is a function of the unit disk into itself. This means that $|f(z)| < 1$ for all $z \in \mathbb{D}$, and in particular this is true for all $z$ in the boundary of the disk $\mathbb{D}(0,r)$ , $r<1$.
You never use or prove $|f(z)|\le1$ on the boundary; in fact, $f$ could fail to be defined on the boundary. What you prove is that for $0<r<1$ $$\frac{|f(z)|}{|z|}\le\frac1r,\quad 0<|z|< r.$$ Fixing $z$ with $|z|<1$ and letting $r\to1$ you get $|f(z)|\le|z|$.
Also, the hypothesis imply that $|f(z)|<1$ if $|z|<1$. If $f$ can be extended to the boundary of $\mathbb{D}$ as a continuous function, it follows that $|f(z)|\le1$ if $|z|=1$.