Let $f:[a,\infty)\rightarrow \mathbb{R}$ be a uniformly continuous function. $\int_{a}^{\infty} f$ converges.Prove that $\lim_{x\to\infty} f(x)=0$

First of all, note that for all $n\in\mathbb{N}$ $$\lim_{x\rightarrow\infty}F_n(x)=n\left[\lim_{x\rightarrow\infty}\left(\int_a^{x+\frac{1}{n}}f(t)\mathrm{d}t- \int_a^xf(t)\mathrm{d}t\right)\right]=n\left[\int_a^{\infty}f(t)\mathrm{d}t-\int_a^{\infty}f(t)\mathrm{d}t\right]=0.$$ Now let $\varepsilon>0$ be arbitrary. By uniform continuity, there is a $\delta>0$ such that for all $t,x\in\left[a,\infty\right)$, we have $|f(t)-f(x)|<\varepsilon$ whenever $|t-x|<\delta$. Pick $N\in\mathbb{N}$ such that $\frac{1}{n}<\delta$ for all $n\ge N$. Then for all $x\in\left[a,\infty\right)$, we have $$\left|n\int_x^{x+\frac{1}{n}}f(t)\mathrm{d}t-f(x)\right|=\left|n\int_x^{x+\frac{1}{n}}f(t)-f(x)\mathrm{d}t\right|\le n\int_x^{x+\frac{1}{n}}|f(t)-f(x)|\mathrm{d}t\le\varepsilon.$$ Since $\varepsilon$ and $x$ were arbitrary, we conclude that $\lVert F_n-f\rVert\rightarrow0$ as $n\rightarrow\infty$, i.e. $F_n\rightarrow f$ uniformly. Thus, $$\lim_{x\rightarrow\infty}f(x)=\lim_{x\rightarrow\infty}\lim_{n\rightarrow\infty}F_n(x)=\lim_{n\rightarrow\infty}\lim_{x\rightarrow\infty}F_n(x)=0.$$


Assume that $\lim_{x \to \infty}f(x) =0$ does not hold and arrive at contradiction with the fact that the integral of $f$ is convergent.

If $\lim_{x \to \infty} f(x) = 0$ does not hold then there exists $\epsilon_0 > 0$ and a sequence $x_n \to \infty$ such that $|f(x_n)| \geqslant \epsilon_0$ for all $n$.

Assume WLOG that $f(x_n) \geqslant \epsilon_0$.

There exists by uniform continuity of $f$ a $\delta > 0$ such that $|f(t) - f(x_n)| < \epsilon_0/2$ for all $t \in [x_n - \delta,x_n + \delta].$

This implies $f(t) > \epsilon_0/2$ and

$$ \int_{x_n - \delta}^{x_n + \delta} f(t) \, dt > \epsilon_0\delta$$

This violates the Cauchy criterion for convergence of the improper integral since $x_n$ can be arbitrarily large.