I have proved the following result:
Assume $f$ and $g$ are continuous and positive. If $\int_0^\infty f(x) \, dx$ converges and $g(x)$ is bounded, then $\int_0^\infty f(x)g(x)\, dx $ converges.
I am trying to now prove the following result, using the above:
Assume $f$ and $g$ are continuous and positive. Show that if $\int_0^\infty f(x) \, dx$ and $\int_0^\infty g(x) \, dx$ converge, this does not imply $\int_0^\infty f(x)g(x) \, dx$
I was told to, in coming up with my counterexample, choose $f = g$ and using the first result to see that $f$ can't be bounded as $x \to \infty$ for this counterexample. However, I am having difficulty coming up with a counterexample to prove the second result.
Indeed, as it was stated in a comment, it's sufficient to find a function $f(x)$ for which $\int_0^\infty f(x)dx$ converges, but $\int_0^\infty f(x)^2dx$ does not. Let's construct such a function.
Take $f(x)=n-n^4|x-n|$ for $x\in[n-1/n^3,n+1/n^3]$, $n=2,3,4...$, and $f(x)=0$ otherwise. So it consists of a series of triangles around $n$. The area of the triangle is $n/n^3=1/n^2$, which implies that the integral $\int_0^\infty f(x)dx$ converges.
If you take $f^2(x)$ and find the area of the corresponding curved triangle around $n$, you'll get $$ \int_{n-1/n^3}^{n+1/n^3}(n-n^4|x-n|)^2dx=\int_{-1/n^3}^{1/n^3}(n-n^4|x|)^2dx=2\int_{0}^{1/n^3}(n-n^4x)^2dx=2\int_{0}^{1/n^3}(n^4x)^2dx=\frac{2n^8}{3n^9}=\frac{2}{3n}. $$ Hence, the integral diverges.