If $f(z)=0$ for some $z\in D$ then since $0$ is a constant, $f'(z)=0$ on $D$. Also since $f$ is analytic, then by theorem $f(z)$ is constant.
Here is where I get stock!
If $f(z)\not=0$. I want to show that $\operatorname{Re}f$ and $\operatorname{Im}f$ are constant using the hint that $\bar f=|f|^2/f.$