Setting: we are given a smooth curve $\gamma: \mathbb{R} \rightarrow \mathbb{R}^n$
Informal Question: Is it possible that $\gamma$ is a straight line on $[a,b]$, but not a straight line on $[a,b]^c$?
Formal Question: It is possible that $\gamma''(t)=0$ for all $t\in [a,b]$, while $\gamma''(t)\neq 0$ for some $t\not\in [a,b]$?
The motivation for me to ask this question is that the textbook we use in our geometry class discusses only smooth curves on bounded open intervals. While I know that the curvature $\gamma''$ can be zero on a point (for instance: $\gamma(t)=(t,\sin t)$ has zero curvature on $\{n\pi:n\in\mathbb{Z}\}$), I can not come up with an example of a smooth curve $\gamma$ such that $\gamma''$ is $0$ on some interval $(a,b)$.
I think such an example if exists will be interesting to see in GGB, but I failed to come up with one due to my inexperience. Thanks for any help.