Inverse of a composite function from $\mathbb R$ to $\mathbb{R}^p$ to $\mathbb R$ again with a non-zero continuous gradient in a point

So Let assume $\nabla f$ exists in a neighborhood of $a$!

$\nabla f(a) \neq 0$ so WLOG let assume $\frac{\partial f }{\partial x_1} (a) \neq 0$ and $f(a)=0$.

This means the function $g(t) = f(a+ t e_1)$ is continuously differentiable at $t=0$ and $g' (0) = \frac{\partial f }{\partial x_1} (a) \neq 0$, so according to the inverse mapping theorem (one dimension case) $g: R \to R$ has an inverse locally around $t=0$ i.e., $g^{-1} : (- \delta , \delta ) \to (- \epsilon , + \epsilon)$ is continuous. Now define $c :(- \delta , \delta ) \to R^p $ with $c(t) = a + g^{-1} (t) e_1$.

P.S : $e_1 = (1,0,0,...,0) $

If it is high price to use invers function theorem , you can argue like as follow WLOG assume $g' (0)= \frac{\partial f }{\partial x_1} (a) > 0$ this guarantees that for small enough $\delta >0,$ $g'(x) > 0$ for all $ x \in (-\delta ,+ \delta )$ because $g'$ is continuous at $t=0$! So $g$ is strictly increasing, thus it has an inverse.


Question's claim as stated is not true:

For $p=1$, let $\phi : R \to R$ be the well-known continuous function, but differentiable no where.

Now Take $f(x):=x + x^2 \phi(x)$ then $f$ is continuous every where $Dom (f')= \{0\}$ and $f' (0) =1 >0$ so $f'$ is continuous. But there is no sub interval $(a,b)$ on which $f$ be invertible on. !