I'm having difficulty answering this question:
Questions statement:
Consider the function: $ f(x) = \begin{cases} 0 & \text{if $x\leq 0$,}\\ e^{-\frac{1}{x}} & \text{otherwise.} \end{cases} $
Show that there exists a positive function $g(x)\in C^{\infty}(\mathbb{R})$ that cancels outside the interval $ ]-1,1[ $ and that satisfies:
$ 1=\int_{\mathbb{R}}^{} g(x) dx $.
Thoughts on what to do
1) I can show that $f$ is infinitely differentiable and define the function $g$ by displacing $f$ over the interval $]-1,1[$ and define $g$ such that it's zero outside the interval $]-1,1[$ - this effectively solves the first part of the question
2) My problem is that I don't know how to guaranty the condition $ 1=\int_{\mathbb{R}}^{} g(x) dx $ without evaluating directly $ \int_{\mathbb{R}}^{} g(x) dx $ which in my mind doesn't have an analytical solution. I think it's the equality here that's got me stumped.
Any help would be appreciated