Suppose $g(x)$ is cubic which has two local extrema.
Is there differentiable function $f(x)$ which satisfies $\forall x \in \mathbb{R}, g(f(x))=x$ exist?
I know if I make $f$ piecewise inverse of $g$, then $g(f(x))=x$ But Can I make $f$ differentiable?
Even if you consider the three pieces independently so that the function is truly invertible, they won't be differentiable. Because
$$(f^{-1})'=\frac1{f'}$$ and the derivative cancels at the stationary points (vertical tangents).