Showing either $f(z)$ or $\overline{f(z)}$ are analytic in certain domain. I am working on the following complex analysis problem, but I have 0 idea on how to do it. I would appreciate any help with it. 
Let $f(z)$ be a complex-valued $C^{\infty}$ function defined on a connected open $\Omega$ of the complex plane. Assume that $f(z)$ and $f^2(z)$ are both harmonic (i.e. the real and imaginary parts of these functions are harmonic). Prove that either $f(z)$ or $\overline{f(z)}$ is analytc in $\Omega$.
I have absolutely no idea on how to attack this problem, so any help with it would be highly appreciated! Thanks!
 A: Hints: We say that f has a partial derivatives in a point z
$z_0=x_0+y_0 i $ if the following numbers $\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y }$ exist (as a limit) at the point $z_0$. We say that f has a total differential $(M,N),M=a+bi,N=c+di $ (1) , if the $$\lim_{h,\eta\to 0}\frac{f(x_0+h+i(y_0+\eta)-f(x_0+iy_0)-Mh-Nh}{\sqrt{h^2+\eta^2}}=0.$$ 


*

*From this definition and by the statement of the problem you can prove firstly that f is differential at a point $z_0$ iff has a total differential at this point.

*Using this you can prove also that if $f$ has a total differential $(M,N)$ defined as in (1) then $\bar{f}$ has a total differential iff $a=-d, b=c$ . 
The previous suggest that the limit 
$$\lim_{z\to z_0}\left|\frac{f(z)-f(z_0)}{z-z_0}\right|$$ exists. So using this you can prove what you want to. The whole proof is too extensive and in fact this is a stronger result as it only requires your function to be differentiable at a point and not holomorphic in a domain. So you prove this for a point and you pass the result in the whole domain.
A: Begin by proving the following
Lemma. If $u$ and $v$ are real harmonic functions of $x$ and $y$ then $$\Delta(u\,v)=2(u_xv_x+u_yv_y),\qquad \Delta(u^2)=2|\nabla u|^2\ .$$
Now to your $f=u+iv:\ $ If $f$ is constant there is nothing to prove. Otherwise we may assume $\nabla u(0,0)\ne{\bf0}$, hence $\nabla u(x,y)\ne{\bf0}$ in a full neighborhood $U$ of $(0,0)$. Since $f^2=(u^2-v^2)+2i\, uv$ is harmonic we may conclude from the Lemma that
$$|\nabla u|^2=|\nabla v|^2\quad \wedge\quad  \nabla u\cdot\nabla v=0\qquad\forall(x,y)\in U\ .$$
It then follows from elementary euclidean ${\mathbb R}^2$ geometry that
$${\rm either}\quad  \bigl(u_x=v_y \ \wedge\ u_y=-v_x)\quad\qquad{\rm or}\quad  \bigl(u_x=-v_y \ \wedge\ u_y=v_x)$$ 
for all $(x,y)\in U$, whereby at all $(x,y)\in U$ the same alternative holds. This allows to conclude that either $f$ or $\bar f$ is analytic in $U$.
