Let $f(z) = \sum a_n z^n$ be a holomorphic function on the unit open disc which takes it to itself. How can I show that for any real $0 <r <1$ it holds that $\sum |a_n|^2 r^{2n} = \frac{1}{2 \pi} \int\limits_0^{2 \pi} |f(re^{it})|^2 dt$. Also, I want to show that the series $\sum |a_n|^2$ converges.
My hope was that we can make a change $r e^{it} = z$ and use complex integration but what we obtain is $\frac{1}{2\pi} \int_{C} \frac{|f(z)|^2}{iz} dz$ where $C$ is the circle around zero of a radius $r$. The problem is that $|f(z)|^2$ is not a holomotphic (or meromorphic) function so we cannot use complex integration. I do not really understand how series $\sum a_n z^n$ and $\sum |a_n|^2 z^{2n}$ (or even $\sum |a_n| z^n$) are related in general. Any ideas would be appreciated.