Showing $f$ is constant using (?) the mean value theorem So I'm working through a packet of old problems and I was wondering if any one could lend me a hand with this one.
Let $D$ be an open domain in $\mathbb{C},$ containing the unit disc. Let $f: D\rightarrow\mathbb{C}$ be analytic. If 
$$|f(0)|^2=\frac{1}{2\pi}\int_0^{2\pi} |f(e^{i\theta})|^2d\theta,$$
show that $f$ is constant.
So my thought is to somehow use the MVP since the methods of Liouville and Max/Min Modulus Principle don't look promising. I just don't see how to connect the above and $$f(0)=\frac{1}{2\pi}\int_0^{2\pi} f(re^{i\theta}) d\theta,$$ where $0<r<1.$
Any suggestions would be appreciated. Thanks.
 A: If we expand $f$ into its power series (with centre $0$),
$$f(z) = \sum_{n = 0}^\infty a_n z^n,$$
then we have
\begin{align}
\lvert f(z)\rvert^2 &= f(z)\cdot \overline{f(z)}\\
&= \Biggl(\sum_{n = 0}^\infty a_n z^n\Biggr)\cdot \overline{\Biggl(\sum_{k = 0}^\infty a_k z^k\Biggr)}\\
&= \Biggl(\sum_{n = 0}^\infty a_n z^n\Biggr)\cdot \Biggl(\sum_{k = 0}^\infty \overline{a}_k\overline{z}^k\Biggr)\\
&= \sum_{n,k = 0}^\infty a_n\overline{a}_k z^n\overline{z}^k,
\end{align}
so
$$\lvert f(re^{i\theta})\rvert^2 = \sum_{n,k = 0}^\infty a_n \overline{a}_k r^{n+k}e^{i(n-k)\theta},$$
where the series converges uniformly and absolutely, which allows the interchange of summation and integration. That gives us
$$\int_0^{2\pi} \lvert f(re^{i\theta})\rvert^2\,d\theta = \sum_{n,k = 0}^\infty a_n \overline{a}_k r^{n+k}\int_0^{2\pi} e^{i(n-k)\theta}\,d\theta.$$
Since $\int_0^{2\pi} e^{im\theta}\,d\theta = 0$ for $m \in \mathbb{Z}\setminus \{0\}$, only the terms with $n = k$ remain in the sum, giving us
$$\int_0^{2\pi} \lvert f(re^{i\theta})\rvert^2\,d\theta = \sum_{n = 0}^\infty a_n \overline{a}_n r^{2n}\cdot 2\pi,$$
or
$$\frac{1}{2\pi} \int_0^{2\pi} \lvert f(re^{i\theta})\rvert^2\,d\theta = \sum_{n = 0}^\infty \lvert a_n\rvert^2\cdot r^{2n} = \lvert a_0\rvert^2 + \lvert a_1\rvert^2 r^2 + \lvert a_2\rvert^2 r^4 + \dotsc.$$
Since $f(0) = a_0$, it follows that $a_n = 0$ for all $n \geqslant 1$.
