This is a homework problem I got, my attempted proof is:
Since $f$ is non constant and analytic, $f=u(x)+iv(y)$ where neither $u$ nor $v$ is constant(by Cauchy Riemann equations) and $u v$ are both analytic in $D$.
Therefore $u$ and $v$ both assume their max on the boundary of $D$ (by maximum modulus theorem).
Also, $u$ and $v$ have no minimums in the interior of $D$ unless they are $0$. I'm stuck here and don't know how to show that $u$ and $v$ are nonzero.
I looked at the answer at the back of the book. They used the Open Mapping Theorem(the image of an open set under a nonconstant analytic mapping is an open set):
According to the Open Mapping Theorem, the image under f of any open set D containing z0 in its interior is an open set containing $f (z_0)$ in its interior. Hence, both Re f and Im f assume larger and smaller values in D than the values $Re f (z_0)$ and $Im f (z_0)$.
I don't understant the proof given by the book, can someone explain a bit? Also, what do you think about my proof?