Let ${ a \lt b }.$ We can try constructing an ${ f \in \mathcal{C} ^{\infty} (\mathbb{R}) }$ which is ${ \gt 0 }$ on ${ (a,b) }$ and ${ 0 }$ everywhere else.
Any such $f$ is a bit interesting : All left hand derivatives ${ f ^{(j)} (a -) }$ are $0$ so all ${ f ^{(j)} (a) }$ are $0.$ Hence all Taylor polynomials ${ P _n (x) = f(a) + f'(a) (x-a) + \ldots + \frac{f ^{(n)} (a)}{n!} (x-a) ^n }$ are $0,$ even though $f$ is nonzero as a function on every ${ (a - \delta, a + \delta) }.$
It suffices to find a ${ g \in \mathcal{C} ^{\infty} (\mathbb{R}) }$ which is ${ \gt 0 }$ on ${ (0, \infty) }$ and $0$ everywhere else.
If ${ g _1, g _2 }$ are two such functions (not necessarily distinct), then ${ g _1 (x - a) g _2 (b - x) }$ would work : It is ${ \mathcal{C} ^{\infty} }$ on $\mathbb{R},$ is $0$ when ${ x \leq a }$ or ${ x \geq b },$ and is $\gt 0$ on $(a,b).$
It suffices to find a ${ h : (0, \infty) \to \mathbb{R} _{\gt 0} }$ which is ${ \mathcal{C} ^{\infty} }$ and such that ${ h(t), \frac{h(t)}{t}, \frac{h'(t)}{t}, \frac{h ^{(2)} (t)}{t}, \ldots }$ all go to $0$ as $t \to 0 ^{+}$
Because then the function which is $h(x)$ on $(0, \infty)$ and $0$ everywhere else is a valid $g.$
Also notice if ${ h _1, h _2 }$ are two such functions and ${ \alpha \gt 0 },$ so are ${\alpha h _1, h _1 + h _2 }$ and ${ h _1 h _2 }.$
Looking for valid $h$ :
We must have ${ \lim _{t \to 0 ^+} \frac{h(t)}{t} = 0 },$ ie ${ \lim _{x \to \infty} x h(\frac{1}{x}) = 0 },$ ie ${ \lim _{x \to \infty} \dfrac{x}{ { \color{purple}{(\frac{1}{ h( \frac{1}{x} ) } )} } } = 0. }$
So maybe setting ${ { \color{purple}{\frac{1}{ h (\frac{1}{x}) }} } = e ^x },$ ie setting ${ h(t) = e ^{- \frac{1}{t} } },$ would work ? We can check it does.
Each ${ \frac{ h ^{(k)} (t) }{t} }$ is an ${ \mathbb{R}- }$combination of finitely many terms of the form ${ e ^{- \frac{1}{t} } t ^{\nu} }$ (with ${ \nu \in \mathbb{Z} }$). Further ${ \lim _{t \to 0 ^{+}} e ^{-\frac{1}{t}} t ^{\nu} = \lim _{x \to \infty} e ^{-x} x ^{-\nu} = 0}$ for every integer $\nu.$
There are many more valid $h.$ For example, the above verification suggests a riskier guess of ${ { \color{purple}{\frac{1}{ h (\frac{1}{x}) }} } = e ^{x ^j} x ^k }$ ${ (j, k \in \mathbb{Z}; j \gt 0), }$ ie ${ h(t) = e ^{ -\frac{1}{t ^j} } t ^k }$ ${ (j, k \in \mathbb{Z}; j \gt 0) }$ could've also worked. A similar verification shows it does work.
Eg: Let ${ a \lt b }.$ Take ${ h _1 (t) = e ^{ - \frac{1}{ t ^2 } } \frac{1}{t ^3} }$ and ${ h _2 (t) = e ^{ - \frac{1}{t} } \frac{1}{t ^2} }$ and consider the corresponding $g _1, g _2.$ Now we see the function, given by ${ \frac{1}{ (t-a) ^3 (b-t) ^2} e ^{ - \frac{1}{(t-a) ^2} } e ^{- \frac{1}{b-t} } }$ on $(a,b)$ and $0$ everywhere else, is ${ \mathcal{C} ^{\infty} }$ on $\mathbb{R}.$
As in Will Jagy's answer, we can get plateau bump functions from these.