# Is it true that for locally $L^p$ integrable function, $\int_{[a,b]} |f(x+y)-f(x)|^p dx \to 0$ as $y \to 0$?

If $f \in L^p(\mathbb{R})$, where $p\in [1, \infty)$, then $$\int_{-\infty}^\infty |f(x+y)-f(x)|^p dx \to 0 \ \textrm {as} \ \ y \to 0.$$

Assume now that a function $f: \mathbb{R} \to \mathbb{R}$ is locally in $L^p$, that is for each compact interval $[a,b]\subset \mathbb{R}$ we have $f \in L^p[a,b]$. I would like to know is it then $$\int_{[a,b]} |f(x+y)-f(x)|^p dx \to 0 \ \ \text{as} \ \ y \to 0.$$

-

This is a consequence of the result you quote. Replace $f$ by zero outside of $[a-1,b+1]$, this yields a function $g$, and consider only values of $y$ such that $|y|\lt1$. Then the result follows from the two following facts: (1) the integral on $[a,b]$ does not change when one replaces $f$ by $g$ in it; (2) the function $g$ is in $L^p$.
Your statement is obviously true when the function is smooth and compactly supported. It holds for $L^p$ functions also, since compactly supported smooth functions are dense in this space.