# A question related to improper integrals

Been stuck on it for quite a while now, any help would be appreciated:

Prove or provide counterexample:

Let $$f$$:[1,$$\infty$$)$$\rightarrow\Bbb R$$ be a continuous function. if $$f>0$$ and integrable on [1,$$\infty$$), then there exists some sequence $${x_n}$$ $$\rightarrow$$ $$\infty$$ such that $$\lim_{n\to \infty}f(x_n)=0$$

My attempted solution:

This statement seems true as I could not find a counterexample, so here is my solution (I got stuck in the process):

Define $$g(x)=\int_{1}^x f(t)dt$$,

then: $$\lim_{x\to \infty}g(x)=\lim_{x\to \infty}\int_{1}^x f(t)dt=L>0$$

By the fundamental theorem of calculus we get:

$$g'(x)=f(x)>0$$

Hence $$g$$ is strictly increasing, is bounded above by $$L$$ and positive.

If only I were able to show that $$\lim_{x\to \infty}g'(x)=0$$ then my proof would be done but I could not figure out how.

For any $$n\in \mathbb N,$$ we must have $$\inf_{[n,\infty)} f=0.$$ Otherwise for some $$n_0,$$ $$\inf_{[n_0,\infty)} f =c>0.$$ We would then have

$$\int_{n_0}^\infty f(x)\,dx \ge \int_{n_0}^\infty c\,dx =\infty,$$

It follows that for each $$n,$$ there exists $$x_n\in [n,\infty)$$ such that $$f(x_n)<1/n.$$ We then have $$x_n\to \infty$$ and $$f(x_n)\to 0$$ as desired.
The thing is that it need not be the case that $$g' = f \to 0$$. Consider, for instance, the case where in each interval $$[n, n+1)$$, the graph of $$f$$ looks like a triangle of height $$n$$ but width $$1/n^3$$, outside of which $$f$$ is $$0$$. Such an $$f$$ of course satisfies the claim, but it scuppers your stategy.
On the other hand, we know that $$\liminf f = 0$$. Otherwise there is some $$\varepsilon > 0$$ such that $$f > \varepsilon$$ for large $$x$$, which makes the integral of $$f$$ blow up. Since $$\liminf$$s are approached arbitrarily closely infinitely many times, this tells us that a sequence of $$x_n$$ such that $$f(x_n) \to 0$$ must exist.
One can be quite explicit in identifying such a sequence. For naturals $$n$$, let $$m_n := \min_{x \in [n,n+1]} f(x),$$ let $$y_n$$ be the corresponding minimiser (which exists because continuous function on a compact set), and consider the step function $$h := \sum m_n \mathbf{1}\{x \in [n, n+1)\}.$$
Then we know that $$h > 0$$ and $$h \le f$$ is integrable. So we know that $$m_n \to 0$$. This gives a sequence of values $$y_n$$ which diverge (since $$y_n \ge n$$), and for which $$f(y_n) \to 0$$.
The only problem with the $$y_n$$ is that some of the consecutive $$y_n$$ may coincide - for instance if the minima are at the even naturals. However, it is trivially true that $$y_n \neq y_{n+2}$$ for any $$n$$, since they live in disjoint sets. The simple fix then is to go in steps of two. So $$x_n = y_{2n}$$ serves as a sequence that satisfies the claim.