If $g(z)^3$ is analytic and $g(z)$ is continous, then $g(z)$ is analytic To be precise, $f(z)$ and $g(z)$ are complex-valued functions defined on a region $S$ of $\mathbb{C}$. My question is, if we know that $g(z)$ is continuous on $S$, $f(z) = g(z)^3$, and $f(z)$ is analytic on $S$, how do we show that $g(z)$ must be likewise analytic on $S$? And furthermore, does this extend to other powers, that is, the condition $f(z) = g(z)^3$ being replaced with $f(z) = g(z)^n$ for some integer $n$?
 A: We need $n \neq 0$ of course, since $g^0$ is the constant, hence analytic, function $z \mapsto 1$, whatever $g$ is.
For $n \neq 0$, we can conclude that $g$ is analytic if $f$ is. If $f \equiv 0$, then clearly $n > 0$ and $g \equiv 0$. Otherwise, $f$ has only isolated zeros, and for $n < 0$ it can't have any. If $f(z)$ is nonzero on a small disk $D \subset S$, then there are $\lvert n\rvert$ holomorphic branches of $f^{1/n}$ on $D$. By continuity, $g$ must be one of those branches, hence $g$ is holomorphic on $D$. Thus we found that $g$ is holomorphic on $S\setminus f^{-1}(0)$. Since the zeros of $f$ are isolated, it follows that $g$ is holomorphic on $S$ by the Riemann removable singularity theorem.
A: Since in the case of complex functions analytic and holomorphic is equivalent (this is a major theorem of complex analysis) we can try to calculate $\dfrac{\partial g}{\partial\bar z}$.
We have $f(z)=h\circ g(z)$ where $h(z)=z^3$.

If we suppose $g$ at least $C^1(\mathbb R^2)$ then we can derivate
$\dfrac{\partial f}{\partial\bar z}=\bigg(\underbrace{\dfrac{\partial h}{\partial z}}_{3z^2}\circ g\bigg)\times\dfrac{\partial g}{\partial\bar z}+\bigg(\underbrace{\dfrac{\partial h}{\partial\bar z}}_{0}\circ g\bigg)\times\dfrac{\partial\bar g}{\partial\bar z}=3\,g^2\dfrac{\partial g}{\partial\bar z}=0$
And can conclude that $\dfrac{\partial g}{\partial\bar z}=0$ whenever $g(z)\neq 0$.
Thus $g$ is analytic at least on $S\setminus g^{-1}(0)$
Although the existence of such $g$ is not straightforward, this is greatly weakening the interest of this method, but somehow explains why $S\setminus g^{-1}(0)$ appears. 
For more details on the existence of n-roots of $f$ see the post I linked in the general comments section. 
A: $g$ is certainly analytic in $S\setminus\{0\}$. By continuity, the singularity at $0$ is removable, hence $g$ is analytic in all of $S$.
A: $g$ is analytic in 
$$
S\setminus g^{-1}(0),
$$
and continuous in $S$, and hence it is analytic in the whole of $S$ (removable singularities), since the elements of $g^{-1}(0)$ do not have an accumulation point in $S$. 
