Given a one-dimensional closed and bounded interval, say $[0,L]$ for some $L > 0$, and fix $\epsilon >0$ to be sufficiently small, i.e., $\epsilon \ll 1$. May I know does there exists a smooth non-negative function (let's call it $f$) on $\mathbb{R}$ such that $f(x) \equiv 0$ for $x \in (-\infty,0] \cup [L,\infty)$ and $f(x) \equiv 1$ for $x \in [\epsilon, L-\epsilon]$ ? I am more eager to see an explicit example of such a function if possible, I would appreciate any help or reference related to this question.
Edit: If possible, I hope such construction does not involve summation of a series.