On the positive half of the $x$-axis, build mutually disjoint triangular "spikes" of base $1/n$ and height $2n$ $(n=1, 2, 3, ...)$ spreading them sufficiently far in the positive direction of the $x$-axis so that when multiplied by $f(x)$, the area of the $n$-th flattened spike becomes smaller than $2^{-n}$. This can be done since $f(x)$ is monotonically decreasing and converges to $0$ as $x\to\infty$. There is your $g(x)$.
Wlodek Kuperberg
- 7.3k
- 28
- 60