The integral in question is
$$\int_0^\infty (f(x)-a)^2dx$$
Where f(x) is some continuous function and a is some constant.
When we expand the integrand,we end up with an $a^2$ term. We can then split up the integral to get:
$$\int_0^\infty [f(x)]^2dx +\int_0^\infty -2af(x)dx+\int_0^\infty a^2dx$$
Now we know that the third of the above integrals diverges, since it just becomes $a^2x$ (which tends to infinity as x increases).
Is this fact enough to demonstrate that the integral diverges? I highly suspect not but don't know for sure.