If $f^2$ and $f^3$ are analytic prove that $f$ is analytic at every point of $\mathbb{C}$. Let $f : \mathbb{C} \to \mathbb{C}$ be continuous. If $f^2$ and $f^3$ are analytic prove that $f$ is analytic at every point of $\mathbb{C}$.

if $f^2$ has no zero then $f=f^3/f^2$ and then it is analytic.but if $f^2$ has zero then how can I able to proceed.help me please.
 A: Suppose that $f^2$ and $f^3$ have zeroes of order $n$ and $m$ at $z_0$, so that $f(z)^2=(z-z_0)^n g(z)$ and $f(z)^3=(z-z_0)^m h(z)$ near $z_0$, with $g$ and $h$ analytic functions such that $g(z_0)\neq0$ and $h(z_0)\neq0$.
Then $f(z)^6=(f(z)^2)^3=(z-z_0)^{3n} g(z)^3$ and $f(z)^6=(f(z)^3)^2=(z-z_0)^{2m} h(z)^2$. It follows that for $z$ near but different from $z_0$, $$(z-z_0)^{3n-2m}=\frac{h(z)^2}{g(z)^3}.$$ Since $hg$ is not zero near $z_0$, the right hand side here is as analytic near $z_0$ and does not vanish there, so that $3n=2m$. In particual, $m=\frac32n>n$ and the quotient $f^3/f^2$ is analytic at $z_0$.
A: If $f^2$ has a zero, then $f^3/f^2$ will have removable singularities at those zeros since $f^3$ will have the same zeros with at least the same multiplicity.
A: At nonzero points this is easy.
At zero points of $f$, look at $f^6$. Since $f^6 = (f^2)^3$, it is analytic and its zeroes have multiplicity divisible by $3$. But since $f^6 = (f^3)^2$, its zeroes have multiplicity divisible by $2$. Therefore its zeroes have multiplicity divisible by $6$ and you conclude that $f$ is analytic, since $\displaystyle f = \frac {f^6} {f^2 \cdot f^3}$.
Edit: Mariano Suárez-Alvarez's answer is the same, but more detailed.
