Let $f$ be analytic on the unit disk $\{ |z| : |z| \leq 1 \}$ and suppose that Im$f(z) >0$ for $z \in D$ and $f(0)=i.$ Prove that $|f'(0)| \leq 1.$ For what functions do we have equality ?
My approach: Let $g(z)=\frac{z-i}{z+i},$ which clearly maps the upper half plane into the unit disk. Then the function $h(z)=g(f(z))$ maps $D$ into $D$ with $g(0)=0.$ Now by Schwarz's lemma, $|h'(0)| \leq 1.$ i.e., $g'(f(0))f'(0) \leq 1.$ But $g'(i)=\frac{1}{2i}.$ Which doesn't give the desired result. Any help in this and to find the class of functions is appreciated.
Your 'proof' is correct and the statement is false: $$f(z) = i \frac{1+z}{1-z}$$ is an example of such a map (the inverse of yours) and its derivative at $0$ is $2i$.