Perturb a piecewise-linear path to make it $C^\infty$ I'm trying to prove that any two points on a path connected smooth manifold can be joined by a smooth path. It becomes easy if I can prove the following:

Given a curve $\gamma :\mathbb{R} \to \mathbb{R}^n$ that is
  $C^\infty$ at each point except at $t=0$ (and which has nonvanishing first derivative), and given a neighborhood $N$
  of $\gamma(0)$ in $\mathbb{R}^n$, there is a $C^\infty$ curve $\tilde{\gamma}:\mathbb{R} \to \mathbb{R}^n$ that agrees
  with $\gamma$ outside $\gamma^{-1}(N)$ (and has nonvanishing first derivative).

(I assume this is true. If there is some counter-example, we could make the domain of the curve compact if that would help.)
When referring to the fact that you can make a small pertubation of a path to make it smooth, some people have waved hands and said "you do it with bump functions". I am familiar with bump functions, but I don't know how to use one to accomplish this. I was thinking convolution with an approximate identity, but that seems to change the function everywhere, not just on a given neighborhood.
Could someone give me a thorough explanation (or a reference for one)?
 A: Here's an argument that should work in $\mathbb{R}^n$ for $n \geq 3$. I guarantee that it is not the most elegant approach.
Assume $\gamma$ contains no segment along a line through the origin. (If $\gamma$ contains one or more such segments, shift it by a translation $\tau$ along a vector not in one of those lines. Then carry out the following procedure, which will only modify $\tau(\gamma)$ only in a small neighborhood of $\tau(\gamma(0))$. Afterwards, shift back by $\tau^{-1}$ to get a smooth arc which agrees with $\gamma$ outside a small neighborhood of $\gamma(0)$.)
Fix $\epsilon>0$ and suppose $b(t)$ is any smooth function $\mathbb{R}\to \mathbb{R}$ that is equal to 1 for $|t| \geq \epsilon$ and whose value and derivatives all vanish at 0. For any vector $v \in \mathbb{R}^n$ we  can consider the path $$\beta(t)=b(t)\gamma(t)+(1-b(t))tv,$$
which is smooth and agrees with $\gamma(t)$ for $|t|\geq \epsilon$. Its  derivative is given by
\begin{align*}
\beta'(t) &= 
b'(t) \gamma(t) + b(t) \gamma'(t)+(1-b(t)-b'(t)t)v.
\end{align*}
Our approach will be to find $b$ and $v$ such that $\beta'(t)$ is nonvanishing. First note that the image of $[-\epsilon,\epsilon]$ under the map $t \mapsto b'(t) \gamma(t)+b(t) \gamma'(t)$ is a smoothly immersed arc in $\mathbb{R}^n$. For $n \geq 3$, there are lines through the origin which intersect this arc in at most one point (and only do so if the arc itself passes through the origin). Choosing $v$ to be any nonzero vector in such a line, we see that the only times $t_0$ at which $\beta'$ can possibly vanish are those such that both


*

*$1-b(t_0)-b'(t_0) t_0=0$, and

*$b'(t_0) \gamma(t_0)+b(t_0)\gamma'(t_0)=0$.


To address this issue, we narrow our search to a specific family of candidates for $b(t)$. Define $f: \mathbb{R} \to \mathbb{R}$ by
$$f(t) = \begin{cases} \left(1+\operatorname{Exp}\left(\frac{1}{t^2}+\frac{1}{t^2-1}\right)\right)^{-1} & |t| < 1 \\ 1 & |t| \geq 1.\end{cases}$$
Then for any $\delta$ satisfying $0<\delta<\epsilon$, it is straightforward to verify that the function $b_\delta(t)=f(t/\delta)$ is smooth and satisfies


*

*$b_\delta(t)=1$ for $|t| \geq \delta$ (hence for $|t|\geq \epsilon$),

*$b_\delta(0)=0$ and $\frac{d^k b_\delta(t)}{dt^k}\big|_{t=0}=0$ for all $k$, and

*$1-b_\delta(t)-t b_\delta'(t)=0$ at precisely two points $t=\pm t_\delta$ for some $t_\delta \in (\delta/2,\delta)$ that varies linearly with $\delta$.


It suffices to show that there exists some $\delta$ such that $b_\delta'(t)\gamma(t)+b_\delta(t)\gamma'(t)$ is nonzero for $t=\pm t_\delta$. Suppose not. Since $t_\delta$ varies linearly with $\delta$, we can find a small interval $(t_{\delta^-},t_{\delta^+})$ such that either $b_\delta'(t)\gamma(t)+b_\delta(t)\gamma'(t)$ or $b_\delta'(-t)\gamma(-t)+b_\delta(-t)\gamma'(-t)$ is zero for each $t \in (t_{\delta^-},t_{\delta^+})$. By continuity, there must actually be a subinterval of $(t_{\delta^-},t_{\delta^+})$ on which either (or both) of $b_\delta'(\pm t)\gamma(\pm t)+b_\delta(\pm t)\gamma'(\pm t)$ vanishes. Without loss of generality, suppose it is $b_\delta'(t)\gamma(t)+b_\delta(t)\gamma'(t)$. Then
$$(b_\delta(t) \gamma(t))'=b_\delta'(t)\gamma(t)+b_\delta(t)\gamma'(t)=0$$
on this subinterval, so $b_\delta(t)\gamma(t)$ is constant there. Since $b_\delta(t)$ is a scalar for all $t$, $b(t)\gamma(t)$ can be constant only if $\gamma$ contains a segment of a line passing through the origin. But we ruled this out back in the beginning. Thus we can find a $\delta$ of the desired form. 
Finally, let's check the result: The derivative
$$\beta'(t)= \big[b'_\delta(t) \gamma(t)+b_\delta(t) \gamma'(t)\big]+\big[(1-b_\delta(t)-b_\delta'(t) t)v\big]$$
never vanishes because the two bracketed terms are never simultaneously zero and are linearly independent whenever they are both nonzero.
A: Let $U \subset \gamma^{-1}(N)$ be a neighborhood of $0$. Choose a smooth function $b : \mathbb{R} \to \mathbb{R}$ which is equal to $1$ outside $U$ and equal to $0$ in a neighborhood of $0$. Define $$\tilde{\gamma}(t) = b(t) \gamma(t).$$ Then $\tilde{\gamma}$ agrees with $\gamma$ outside of $\gamma^{-1}(N)$ ; it is smooth on $\mathbb{R}$ since it is constant near $t = 0$ and equal to a product of smooth functions for $t \neq 0$.
Edit: If $n \ge 2$, then $\tilde{\gamma}$ can be perturbed to obtain an immersion; see e.g. theorem 2.12 in chapter 2 of Differential Topology by Morris Hirsch. However, if your goal is simply to show that two points in a connected manifold can be joined by an immersed path, there is a more elementary approach.
Let $M$ be a smooth connected manifold and let $x$ and $y$ be two distinct points of $M$. Choose a point $z \in M\setminus\{x,y\}$ such that there exists a coordinate chart containing both $x$ and $z$. Then one can easily find a smooth embedded path $\gamma : [0,1] \to M$ such that $\gamma(0) = x$ and $\gamma(1) = z$. Since $M$ is connected, there exists a diffeomorphism $h : M \to M$ satisfying $h(x) = x$ and $h(z) = y$. Then $h\circ\gamma$ is an embedded path going from $x$ to $y$.
The fact that such an $h$ exists is not trivial, but not difficult to prove either. A reference is the book Differential Topology by Guillemin and Pollack, chapter 3, $\S$6. See also the "Homogeneity lemma" in $\S$4 of Milnor's Topology from the differentiable viewpoint for an alternative proof.
