If $f$ and $f\circ h$ are nonconstant and real-analytic, with $h\in C^\infty$, does it follow that $h$ is also real-analytic? Let $f,g:I\to\mathbb{R}$ be two real, non-constant, analytic functions on an open interval $I\subset\mathbb{R}$. If there is a smooth function $h:I\to\mathbb{R}$ (i.e. $h\in C^{\infty}(I)$) such that: $(f\circ h)(t)=g(t),\ \forall\ t\in I$, is it true that $h$ is also analytic on $I$?
If we add that $f'$ does not vanish nowhere, then the answer is yes.

It can be checked locally. As $f$ is real-analytic, it extends analytically in an neighbourhood of $h(I)$ in $\mathbb C$ - We assume that $f$ is real analytic on an interval $J$, with $h(I)\subset J$.

Let now $h(t_0)=w_0\in h(I)$. 

As $f'(w_0)\ne 0$, then $f$ possesses an analytic inverse $F$ in a neighbourhood $D(w_0,r)\subset \mathbb C$ of $t_0$,  and hence $h=F\circ g$, for $t\in I$, such that $h(t)\in (w_0-r,w_0+r)$, and therefore $h$ is analytic in a neighboorhood of $t_0$.

However, if $f'$ vanishes, then it DOES NOT hold. For example $h(x)=\lvert x\rvert$ and $f(x)=x^2$.
If we add that $f'$ does not vanish nowhere, then the answer is yes.

It can be checked locally. As $f$ is real-analytic, it extends analytically in an neighbourhood of $h(I)$ in $\mathbb C$ - We assume that $f$ is real analytic on an interval $J$, with $h(I)\subset J$.

Let now $h(t_0)=w_0\in h(I)$. 

As $f'(w_0)\ne 0$, then $f$ possesses an analytic inverse $F$ in a neighbourhood $D(w_0,r)\subset \mathbb C$ of $t_0$,  and hence $h=F\circ g$, for $t\in I$, such that $h(t)\in (w_0-r,w_0+r)$, and therefore $h$ is analytic in a neighboorhood of $t_0$.

However, if $f'$ vanishes, then it DOES NOT hold. For example $h(x)=\lvert x\rvert$ and $f(x)=x^2$.