The problem goes as follows:
Assume $f(z)$ is analytic inside the unit disk $D=\{z:|z|<1\}$. Also, $f(0)=0$ and $|f(z)|\leq M$ in $D$.
Prove that $|f(z)|\leq M|z|$ in $D$. When does equality occur?
This seems like an easy problem, but I can't seem to come up with a solution.
I have tried using Cauchy's integral formula and the ML-inequality, but I am stuck here:
$|f(z)|=|\frac{1}{2\pi i}\oint_{C_r} \frac{f(\zeta)}{\zeta-z}d\zeta|\leq\frac{1}{2\pi}\frac{M}{r-|z|}2\pi r=\frac{Mr}{r-|z|}$
where $C_r$ is a circle of radius $r$ inside $D$.
Any help would be appreciated.
As suggested, write $f(z) = zg(z)$ (where $g$ is also holomorphic on $|z|<1$). Then for $|z|\le r$ and $r < 1$, $$ |g(z)| = \frac{|f(z)|}{|z]} \le \frac{M}{r}. $$ Letting $r \to 1^-$, it follows that $$ |g(z)| \le M $$ for all $z \in D$. Hence $|f(z)| \le M |z|$ for $z \in D$. (This is a variant of Schwarz' lemma.)
Equality can only happen (at $z=0$ or) if $|g(z)| = M$ for some $z \in D$. But then, the maxmimum modulus principle forces $g(z)$ to be constant on $D$, $g(z) = Me^{i\theta}$ for some real $\theta$, and consequently $f(z) = Mze^{i\theta}$.