Function $f$ which isn't smooth but $f^3$ is smooth
For a resolution of the exercise, see
http://www.math.ucla.edu/~tao/whatsnew.html
The Feb 16,2007 comment contains a proof that if $f^2$ and $f^3$ are smooth, $f$ is smooth.
The idea is that it's easy to have a cusp that is "cured" by either squaring or cubing the function (or raising it to any other particular power), but more difficult to think of a case where both operations work. The simplest parametrized family of examples where $f$ is not smooth, but $f^{1+a}$ is, is probably $f(x; a)=\lvert x \rvert^{2/(1+a)}$. Choosing $a=1$ or $a=2$ gives the desired examples where $f^2$ and $f^3$ are smooth.
How about: $$y=\sin^{1/3} x,\;\;x>0$$
(if by $f^3$ you mean $f(x)^3$ of course)