Let $f:[0,\infty)\to\mathbb{R}$ be a continuous function. I was asked to prove/disprove the following statement:
If $\int_{1}^{\infty}f\left(x\right)dx$ converges absolutely then $\int_{1}^{\infty}f^{2}\left(x\right)dx$ converges as well.
I figure that my only way of proving this is by direct comparison. However, for that to work I need $f(x)\leq1$ for sufficiently large $x$, but $\int_{1}^{\infty}f\left(x\right)dx$ converging (Even absolutely) does not guarantee this.
If the statement is false I'd appreciate a hint on how to construct a counter example, rather then one pulled out of thin air.
Idea: $\ f$ is the zero function except tiny neighbourhoods around positive integers.
Above is an idea for such a function. Observe that $f(n)=2^{n-1}$.
Let's call the trapezoids $T_1,T_2,T_3$ and so on.
Make sure that the area below the upper base of each trapezoid $T_n$ is $2^{-n}$. (by manipulating its endpoints)
Also make sure that the sum of the area under the left and right sides of each trapezoid is $2^{-n}$.
So, the area under each trapezoid is $2.2^{-n}$.
So, the integral $\displaystyle \int_0^\infty f(x) \ \mathrm dx = \sum_{n=1}^\infty 2. 2^{-n} = 2$. $\implies f$ is absolutely convergent.
Now, when you square $f$, the height of the upper base of each $T_n$ will be squared.
For example, the height of $T_1$ will be $1$, the height of $T_2$ will be $4$ etc.
Also, the shape of the left and right sides of each trapezoid will be different, but we're not interested in that.
Anyways, the area under the upper base of $T_n$ will be $(2^{n-1})^2 \cdot 2^{-n}= 2^{n-2}$.
$\implies$ areas under upper bases of "squared trapezoids" will be divergent.
Hence $\displaystyle \int_0^\infty f^2(x) \ \mathrm dx$ is divergent.