Suppose $f$ is a $C^\infty$ function from the reals to the reals that is never negative. Does it have a $C^\infty$ square root? Clearly the only problem points are those at which $f$ vanishes.

The answer is "no". This is covered in great detail here: 


The function $$f(x) = \begin{cases} \sin^2 \left(\frac{1}{x} \right) e^{1/x} + e^{2/x} & \text{if $x > 0$,}\\ 0 & \text{if $x \leq 0$,} \end{cases}$$ is $C^\infty$ but has no $C^2$ square root. I found this example in the paper Choosing roots of polynomials smoothly by Alekseevsky, Kriegl, Losik, and Michor (available freely here). This example appears to have come from Frank Warner's (unpublished) 1963 dissertation. 

