Help proving statement in Lee's Introduction to Riemannian Manifolds about smooth curves into manifolds with nonempty boundary. The statement appears on page 33 of the second edition of Professor Lee's Introduction to Riemannian Manifolds. It is in the section on Lengths and Distances in Riemannian manifolds, but I think the statement may be generally true even if there is no Riemannian metric given for the manifold. Here is the relevant paragraph:
"Without further qualification, a curve in $M$ always means a parameterized curve, that is, a continuous map $\gamma\colon I\to M$, where $I\subseteq\mathbb{R}$ is some interval. ... To say that $\gamma$ is a smooth curve is to say that it is smooth as a map from the manifold (with boundary) $I$ to $M$. If $I$ has one or two endpoints and $M$ has empty boundary, then $\gamma$ is smooth if and only if it extends to a smooth curve defined on some open interval containing $I$. (If $\partial M\neq\varnothing$, then smoothness of $\gamma$ has to be interpreted as meaning that each coordinate representation of $\gamma$ has a smooth extension to an open interval.)"
I believe I have a correct proof of the statement for the case when $M$ has empty boundary. It is the parenthetical statement that follows, about the case when the boundary of $M$ is nonempty, that has me stymied. I have sketched a proof of one direction of that statement, namely the "if" direction. It is the "only if" direction that I can't get a handle on.
That is, I assume that $\gamma$ is smooth, $(U,\phi)$ is a smooth chart for $I$,
$(V,\psi)$ is a smooth chart for $M$, and $\gamma(U)\subseteq V$. I set
$\hat{\gamma}=\psi\circ\gamma\circ\phi^{-1}\colon\phi(U)\to\psi(V)$. By definition, $\hat{\gamma}$ (which is a coordinate representation of $\gamma$) is smooth, and I need to find an open interval $J$ which contains $\phi(U)$ and a smooth map $\Gamma\colon J\to\mathbf{R}^n$ such that
$\Gamma|_{\phi(U)}=\hat{\gamma}$. Here, I have assumed that $\dim M=n$. I tried to work on a simpler version of this problem, so I assumed first that $\phi(U)$ was open in
$\mathbb{R}$ (it could be open in the half-space instead). Then a plausible candidate for $J$ is $(\inf\phi(U),\sup\phi(U))$. But how would I define $\Gamma$ so as to match $\hat{\gamma}$? I know $\phi(U)$ is a countable collection of disjoint open intervals, but I haven't been able to figure out how to use something like a partition of unity to glue the restrictions of $\hat{\gamma}$ to each interval in the collection together to make $\Gamma$. That is mostly because I haven't come up with a reasonable  open cover for $J$. Also complicating things is that an interval which appears in $\phi(U)$ might actually have been flipped by $\phi$ compared to the interval it came from in $I$. For example, if $(-1,1)\subseteq I$, $\phi$ might multiply it by $-1$ but not do that to other nearby subintervals.
Can someone please offer some suggestions on how to go about proving the parenthetical statement.
 A: The condition

If $\partial M\neq\varnothing$, then smoothness of $\gamma$ has to be interpreted as meaning that each coordinate representation of $\gamma$ has a smooth extension to an open interval

is inadequate. It has to be replaced by

If $\partial M\neq\varnothing$, then smoothness of $\gamma$ has to be interpreted as meaning that each coordinate representation $\hat \gamma : \phi(U) \to \psi(V)$ of $\gamma$ has a smooth extension to an open subset $V \subset \mathbb R$ containing $\phi(U)$.

Let us recall the definition of a smooth map $f :A \to \mathbb R^k$ on an arbitrary subset $A \subset \mathbb R^n$ given in Appendix A (Review of Smooth Manifolds) p. 374 :

First, we note that when $U $is an open subset of $\mathbb R^n$, a map $F  : U \to \mathbb R^k$ is said to be smooth (or of class $C^\infty$) if all of its component functions have continuous partial derivatives of all orders. More generally, if the domain $U$ is an arbitrary subset of $\mathbb R^n$, not necessarily open (such as a relatively open subset of $\mathbb R^n_+$), then $F$ is said to be smooth if for each $x  \in U$, $F$ has a smooth
extension to a neighborhood of $x$ in $\mathbb R^n$.

Also have a look to p. 20 and p. 428 of [John M. Lee, Introduction to Smooth Manifolds, 2nd ed., Graduate Texts in Mathematics, vol. 218, Springer, New York, 2013].
Let us emphasize that the above requirement ($F$ has a smooth extension to a neighborhood of $x$) may be a bit misleading. It means that there exists an open neigborhood $W$ of $x$ in $\mathbb R^n$ and a smooth map $F_x : W \to \mathbb R^k$ such that $F_x \mid_{U \cap W} = F \mid_{U \cap W}$. It is therefore only relevant for points $x$ which do not belong to the topological interior of $U$ in $\mathbb R^n$.
Now consider your coordinate representation $\hat \gamma$. The chart $(\psi,V)$ maps $V$ to an open subset $V' \subset \mathbb R^k_+$. This set is open in $\mathbb R^k$ if $M$ has no boundary or $V$ is contained in the interior of $M$. Anyway, we regard $\hat \gamma$ as a map into $\mathbb R^k$.
$U$ is an open subset of $I$ which is mapped by $\phi$ to an open subset $U' = \phi(U) \subset \mathbb R_+$. This set is either open in $\mathbb R$ or contains $0 \in \mathbb R_+$. The above smooth extension condition is only relevant for $x = 0$ provided $0 \in U'$. In this case the definition of smooth says that there exists an open neighborhood $W$ of $0$ in $\mathbb R$ and a smooth  $\gamma^* : W \to \mathbb R^k$ such that $\gamma^* \mid_{U' \cap W} = \hat \gamma \mid_{U' \cap W}$. Then $\hat \gamma$ and $\gamma^* \mid_{W \cap (-\infty,0]}$ can be pasted to a smooth $\bar \gamma : U' \cup (W \cap (-\infty,0]) \to \mathbb R^k$ which is an extension of $\bar \gamma$ to an open set containing $U'$.
Why is it impossible to require that $\hat \gamma$ has a smooth extension to an open interval? The reason is simple: The set $\hat\gamma^{-1}(\partial M)$ is in general not be an interval, but the disjoint union of open intervals and at most one interval of the form $[0,r)$. We certainly find a smooth map $\gamma^* : (-s,r) \to \mathbb R^k$ extending $\hat \gamma \mid_{[0,r)}$, but $(-s,r) \cup U'$ is not an interval.
