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)$ converges to $0$ as $x\to\infty$. There is your $g(x)$. Remark: I just edited this answer. The assumption of monotonicity of $f$ is redundant. The construction of $g$ does not require it. It suffices that $\displaystyle\lim_{x\to\infty}f(x)=0$.