Showing $\int_x^{x+1}f(t)\,dt \xrightarrow{x\to\infty}0$ for $f\in L^2 (\mathbb{R})$

Using Jensen's Inequality, the sum $$ \begin{align} \sum_{n=0}^\infty\left(\int_n^{n+1}|f(x)|\,\mathrm{d}x\right)^2 &\le\sum_{n=0}^\infty\int_n^{n+1}|f(x)|^2\,\mathrm{d}x\\ &=\int_0^\infty|f(x)|^2\,\mathrm{d}x\\ &\le\|f\|_{L^2(\mathbb{R})}^2 \end{align} $$ converges, which means the terms must go to $0$. That is, $$ \lim_{n\to\infty}\int_n^{n+1}f(x)\,\mathrm{d}x=0 $$


Continuing from your last step, you have

$$|g(x)|\leq\left(\int_\mathbb{R} f(t)^2\chi_{[x,x+1]}\,dt\right)^{1/2}$$ where $\chi_{[x,x+1]}(t)$ is the indicator function on the interval $[x,x+1]$.

So $$\lim_{x\to\infty}|g(x)|\leq\lim_{x\to\infty}\left(\int_\mathbb{R} f(t)^2\chi_{[x,x+1]}\,dt\right)^{1/2}$$

Since $|f(t)^2\chi_{[x,x+1]}|\leq|f(t)^2|$ which is integrable, by Lebesgue's Dominated Convergence Theorem, we can move the limit inside the integral, so

$$\lim_{x\to\infty}\left(\int_\mathbb{R} f(t)^2\chi_{[x,x+1]}\,dt\right)^{1/2}=\left(\int_\mathbb{R} \lim_{x\to\infty}f(t)^2\chi_{[x,x+1]}\,dt\right)^{1/2}=0$$

since $\lim_{x\to\infty}\chi_{[x,x+1]}=0$

Hence $\lim_{x\to\infty}|g(x)|\leq 0$, and we can conclude from there.


The result is valid for functions in $C_0^\infty(\mathbb R)$. So, it is true for functions in $L^2(\mathbb R)$ (as well as for functions in $L^p(\mathbb R)$ with $1\leq p<\infty$) by density.

Details: As $C_0^\infty(\mathbb R)$ is dense in $L^2(\mathbb R)$, there is $(f_n)$ in $C_0^\infty(\mathbb R)$ such that $$\|f_n-f\|_{L^2(\mathbb R)}\xrightarrow{n\to\infty} 0.\tag{1}$$ Take $\varepsilon>0$. We want to show that there exist $M>0$ such that $$x>M\quad\Longrightarrow \quad |g(x)|<\varepsilon.$$

From $(1)$ there is $n_0\in\mathbb N$ such that $$\|f_{n_0}-f\|_{L^2(\mathbb R)}<\varepsilon.\tag{2}$$

As $f_{n_0}$ has compact support, there is $M>0$ such that $$|x|>M\quad\Longrightarrow \quad|f_{n_0}(x)|=0.\tag{3}$$

From $(2)$, $(3)$ and your estimate, $$\begin{align} x>M\quad\Longrightarrow \quad |g(x)|\leq \|f\|_{L^2(x,x+1)}&\leq\|f_{n_0}-f\|_{L^2(x,x+1)}+\|f_{n_0}\|_{L^2(x,x+1)}\\ &\leq\|f_{n_0}-f\|_{L^2(\mathbb R)}+\|f_{n_0}\|_{L^2(x,x+1)}\\ &<\varepsilon+0=\varepsilon. \end{align}$$