compactly support function with constant value

73 Views Asked by At

I am interested in finding a function $\varphi\colon\mathbb{R}\to\mathbb{R}$ with the following property:

  • $\varphi$ has compact support, which contains $\left[0,1\right]$
  • $\varphi$ is continuously differentiable on $\mathbb{R}$ at every order.
  • $\varphi$ is constant on (at least one) an intevarl of the form $\left[0,1/n\right]$, where $n\in\mathbb{N}$.

As pointed out in an exercise in the book "Functional Analysis, Sobolev Spaces, and Differential Equations" by Haim Brezis, we can construct one via mollifiers. However, it does not seem to give a closed form or explicit formula that we can easily play with.

So here is my question: Is there an example where we have a closed form that is easy to play with?

Any help/hint is highly appreciated.