This is a question that I came across in a math competition and I solved it the following way. But unfortunately, I received 0 out of 20. Are there any errors in my reasoning?
$f: \mathbb{C}\to \mathbb{C}$ and $f$ is analytic everywhere in the complex plane. $\forall z \in C$ we have $f(z)= f\left(z-z^2\right)$. Prove that $f(z)$ has to be a constant in the entire plane.
My approach: Since $f$ is analytic everywhere, therefore its Taylor series expansion about $z=0$ has to be convergent $\forall z\in C$. Therefore we have: $$ \begin{split} f(z) &= f(0) + f'(0) z + \frac{f''(0)}{2} z^2 + \ldots \\ f(z-z^2) &= f(0) + f'(0)(z-z^2) + \frac{f''(0)}{2} (z-z^2)^2 + \ldots \end{split} $$
So the two series are equal for all complex inputs, therefore the coefficients of the same powers of $z$ have to be equal. So I went on calculating the coefficient of $z^2$ in the second series and concluded that $\frac{f''(0)}{2} = - f'(0) + \frac{f''(0)}{2}$. So $f'(0)=0$. I decided to prove by induction that $\forall n \in N, f^n(0)=0$ and therefore, the proof will be complete.
Suppose that $f'(0) = f''(0) = ... = f^n(0)=0$. If we can prove that $f^{n+1}(0)=0$, the induction will be complete. By the hypothesis of the induction we have: $$ f(z) = f(0) + \frac{f^{n+1}(0)}{(n+1)!}z^{n+1} + \frac{f^{n+2}(0)}{(n+2)!}z^{n+2} + \ldots $$ and therefore, $$ f(z-z^2) = f(0) + \frac{f^{n+1}(0)}{(n+1)!}(z-z^2)^{n+1} + \frac{f^{n+2}(0)}{(n+2)!}(z-z^2)^{n+2} + \ldots $$
By using the Newton's binomial formula I calculated the coefficients of $ z^{n+1}$ and $z^{n+2}$ and concluded that $ \frac{f^{n+2}(0)}{(n+2)!} = \frac{f^{n+2}(0)}{(n+2)!}- (n+1)\frac{f^{n+1}(0)}{(n+1)!}$ and finally $f^{n+1}(0) = 0$ Therefore, $f(z) = f(0) \ \forall z \in C$.
Your approach looks sound and is in addition to the Identity theorem mentioned in the comment section a nice and instructive solution.