Do you know of any functions which resemble this function?

I am looking for a function which is non $$0$$ between two $$x$$ coordinates and $$0$$ for all other coordinates. I have found one function like this, which is $$\frac{1}{x^{\infty}+1}$$: see image. However, it is not ideal, as $$1^{\infty}$$ is indeterminate. Do you know of any other such functions? I have also played around with equations involving square roots, however this doesn't seem to work as then the function is undefined for all values not between the x coordinates, which is something that I don't want.

• What kind of functions are you looking for? It's very trivial if you allow for piecewise functions. (Though $x^\infty$ is hardly a well-defined, good notation.) Mar 3 at 5:34
• Yes, @Mather: What is your definition of function? The answer Mike Pierce gave is perfectly fine. Mar 3 at 5:42

$$f(x) = \begin{cases}1 \text{ if } |x|<1\\0 \text{ otherwise}\end{cases}$$