Let $f :\mathbb{R}→ \mathbb{R}$ be a function such that $f^2$ and $f^3$ are differentiable. Is $f$ differentiable? Let $f :\mathbb{R}→ \mathbb{R}$ be a function such that $f^2$ and $f^3$ are differentiable. Is $f$ differentiable?
Similarly, let $f :\mathbb{C}→ \mathbb{C}$ be a function such that $f^2$ and $f^3$ are analytic. Is $f$ analytic?

If you do want $f^{p}$ to represent the $p^{\text{th}}$ iterate, then you can let $f$ denote the characteristic function of the irrational numbers.  Then $f^2$ and $f^3$ are both identically zero, yet $f$ is nowhere continuous, let alone differentiable.
