Proving that if $f: \mathbb{C} \to \mathbb{C} $ is a continuous function with $f^2, f^3$ analytic, then $f$ is also analytic 
Let $f: \mathbb{C} \to  \mathbb{C}$ be a continuous function such that $f^2$ and $f^3$ are both analytic. Prove that $f$ is also analytic.

Some ideas: At $z_0$ where $f^2$ is not $0$ , then $f^3$ and $f^2$ are analytic so $f = \frac{f^3}{f^2}$ is analytic at $z_0$ but at $z_0$ where $f^2$ is $0$, I'm not able to show that $f$ is analytic.

First rule out the case $f^2(z)\equiv 0$ or $f^3(z)\equiv 0$ as both imply $f(z)\equiv 0$ and we are done.
Write $f^2(z)=(z-z_0)^ng(z)$, $f^3(z)=(z-z_0)^mh(z)$ with $n.m\in\mathbb N_0$,  $g,h$ analytic and nonzero at $z_0$. Then 
$$(z-z_0)^{3n}g^3(z)=f^ 6(z)=(z-z_0) ^ {2m} h^2 (z)$$
implies $3n=2m$ (and $g^3=h^2$), hence if we let $k=m-n\in\mathbb Z$ we have $n=3n-2n=2m-2n=2k$ and $m=3m-2m=3m-3n=3k$. Especially, we see that $k\ge 0$ and hence 
$$ f(z)=\frac{f^3(z)}{f^2(z)}=(z-z_0)^k\frac{g(z)}{h(z)}$$
is analytic at $z_0$.
Remark: We did not need that $f$ itself is continuous.
