$$f(x) = \begin{cases} e^{-1/(1 - x^2)} & -1 < x < 1\\ 0 & \text{otherwise} \end{cases} $$
I noticed that when I multiply the denominator of the fractional part of this function (the $1 - x^2$ part) by larger and larger numbers, the "bump" almost reaches $1$, but it never does (even when I put in $99999\cdot1 - x^2$). I am trying to modify this function so that $f(x) = 1$ for $a \leq x \leq b$, where $a = b = 0$ in this particular case, but still maintain that $f(x) = 0$ for $x < \alpha$ and $x > \beta$ where $\alpha = -1$ and $\beta = 1$ in this case. $f(x)$ must also be smooth.
If you're trying to make the maximum value of the function 1, just divide it by its maximum value, so it'll be 1 at the maximum.
If you want to define a $C^\infty$ function that is 1 on $[-a,a]$ and 0 outside the interval $[-b,b]$ with $a<b$, you can do the following.
Scale and shift your argument x so that your function is supported on $[-b,-a]$. Subtract another copy of it that's supported on $[a,b]$. Now if you integrate this function from $-\infty$ to $x$ you'll get a function that's similar to what you want, but its maximum value is not 1. Just divide it by the integral under one of the bumps to make it 1.