How to define a (bump) function in $[0,1]$ that takes $0.1$ value in $x=0.5$ and $0$ if $x\geq1$ and $x\leq0$, so it is $\varepsilon$ small.
I had created one in $[0,4]$ that takes $2$ value if $x\geq4$ and $x\leq0$ as
\begin{align} f(x) = \begin{cases}e^{1-4(x-2)^2}+2 & x<4 \text{ or } x>0\\ 2 & x\geq 4 \text{ and } x \leq 0 \end{cases} \end{align}
but I can't modify it for this example.
Consider:
$$f(x) = \begin{cases} 0.1 e^{-\frac{(x-0.5)^2}{0.5^2 - (x-0.5)^2}}, \text{ if $x \in (0,1)$} \\ 0, \text{otherwise} \end{cases}$$