If $f^2$ and $f^3$ are $C^{\infty}(\mathbb R)$ then $f$ is $C^{\infty}(\mathbb R)$ Since it is an exercise from an oral exam, I have added some indications I had.
$f : \mathbb R \to \mathbb R$, such that $f^2$ and $f^3$ are $C^{\infty}$, show that $f$ is $C^{\infty}$.
The two isolated hypothesis are not sufficient, since there is a problem in zero for the cube root, and since you can take $f$ that takes $1$ and $-1$ without regularity but its square will be constant.
How to proceed with the two hypothesis?

Here, the indications I have from the candidate who has taken the oral exam:
-First, show that $f$ is $C^1$:
Suppose $f(0) = 0$ (it is exactly the problem, and by translation we consider that it is in $0$). Suppose they exist and use the Taylor expansions of $f^2$ and $f^3$ up to a non-zero order. Find a polynomial link between both coefficients using equivalents. If they do not exist, $f^2 =o(h^4)$ so $f$ is $C^1$ in $0$ (?).
-Use the general Taylor expansion (with integral remain) for $f^3$.  Suppose the coefficients are not all zeros, (change the bounds to $0$ and $1$), show that the parameter integral is $C^{\infty}$, then take the cube root (??).
 A: This is not really an answer, I've posted this as a comment on the question above, I just think the information needs to be more prominently displayed for future viewers.
On the answer to the MO question  addressing this, Terry Tao commented with the following link to his write up of the solution to the problem based on one of the papers in the answer: http://www.math.ucla.edu/~tao/preprints/Expository/squarecube.dvi.
To convert dvi to pdf, see this tex.SE answer.
A: The obvious thing is to consider $$g=\begin{cases}f^3/f^2,&(f^2\ne0),\\0,&(f^2=0).\end{cases}$$It's not hard to show that $g$ is continuous: If $f^2\ne0$ and $|f^2|<\epsilon$ then $|g|<\epsilon^{1/2}$. One can imagine showing "directly" that $g^{(k)}$, defined at first on the set $f^2\ne0$, extends continuously to $\Bbb R$, but it seems like things are going to get worse and worse as $k$ increases.
The point to this non-answer is to point out that at least one approach to a more elegant solution cannot work: For a little while I thought about looking for a smooth function $F(x,y)$ such that $$F(t^2,t^3)=t.$$But that's impossible; differentiating gives $$2tF_x(t^2,t^3)+3t^2F_y(t^2,t^3)=1,$$which implies $0=1$.
