TITLE: Smoothness of $f(\sqrt x)$
QUESTION [17 upvotes]: I found that I need to use the following facts in a paper that I am writing.
Let $f\in C^\infty(\mathbb R)$, then

If $f(0)=0$, then $f(x)=x g(x)$ for some $g\in C^\infty(\mathbb R)$.
If $f$ is even, i.e. $f(-x)=f(x)$ for all $x$, then $f(x)=g(x^2)$ for some $g\in C^\infty(\mathbb R)$.

These facts are trivial for analytic functions (just look at the Taylor series). In the smooth case, one can prove them by analyzing the derivatives of $f(x)/x$ and $f(\sqrt x)$, respectively, and showing that they have certain limits at 0. However this is somewhat cumbersome (especially if one wants to analyze how $g$ depends on $f$). This is not a problem for me because the facts fall into the category "you should be able to prove this yourself if you are reading my paper". But I would like to know if there is a nicer proof.
For the first statement, I know the following trick (which can be found in textbooks): define
$$
 g(x) = \int_0^1  f'(tx) \ dt
$$
and observe that $f(x)=xg(x)$, and $g\in C^\infty$ since the function $t\mapsto f'(tx)$ under the integral is smooth in the parameter $x$. As a bonus, this argument also shows easily that $g$ (as a point of $C^\infty$) depends smoothly on $f$. (This is another fact that I need to use.)
Is there a similarly nice proof of the second statement? And, by the way, is there a textbook reference for it?
Added. Here is a more precise mathematical question that more or less formalizes what I mean. The function $g$ such that $f(x)=g(x^2)$ is uniquely defined only on $\mathbb R_+$, and its extension to negative arguments involves some choice.
Is there a canonical way to associate $g$ to $f$? Even more precisely, can one make a mapping $f\mapsto g$ which is linear, preserves the pointwise multiplication, and is continuous as a map from $C^\infty$ to $C^\infty$?

REPLY [3 votes]: There are general results on $C^\infty$ functions of several variables which are invariant under the action of a group, many of them due to Georges Glaeser. One of most beautiful is the following: take a $C^\infty$ function $f(x_1,\dots,x_n)$ which is symmetric, i.e. such that
for all permutations $\sigma$ of $\{1,\dots,n\}$,
$$
f(x_{\sigma(1)},\dots,x_{\sigma(n)})=f(x_1,\dots,x_n).
$$
Then it is a $C^\infty$ function $F$ of the standard symmetric functions
$$
\sum x_j,\dots,\prod x_j.
$$
This result is elementary for polynomials ($f$ polynomial, then $F$ polynomial) but the above result is highly non-trivial for smooth non-analytic functions.