I'm searching for a generalization of the following observation: If $f\in L^2(\mathbb R)$, then \begin{equation}\begin{split}\int_{[-n,\:n+1]}f(x)\:{\rm d}x&=\left\langle1_{[-n,\:n+1]},1_{\mathbb R\setminus[-n,\:n)}g\right\rangle_{L^2(\mathbb R)}\\&\le\left\|f-1_{[-n,\:n)}f\right\|_{L^2(\mathbb R)}\xrightarrow{n\to\infty}0\end{split}\tag1\end{equation} by the Cauchy-Schwarz inequality and Lebesgue's dominated convergence theorem.
$(1)$ captures the idea that an integrable function should "vanish at infinity" in a suitable sense.
Can we generalize this result to $f\in L^p(\mu)$, where $(E,\mathcal E,\mu)$ is an arbitrary measure space and $p\ge1$? Maybe assuming that $\mu(E)=\infty$ and/or that $E$ is a metric/normed space with $\mathcal E=\mathcal B(E)$?
In the case of a metric/normed space, the intuition tells me that an integrable function should "essentially be supported in a compact set".
What's obviously true is that $$\forall f\in L^p(\mu):\not\exists B\in\mathcal E:\mu(B)=\infty\text{ and }\inf_{x\in B}|f(x)|>0\tag2.$$
Isn't this almost trivial by contradiction? Let $E$ be a normed vector space and denote $B_r := \{x \in E : \|x\|_{E} \le r \}$, let also $f \in L^1(E)$ with respect to the measure $\mu$. We will now prove that $$ \tag{1} \lim_{n \to \infty} \int_{B_{n+1} \setminus B_n} f \, d\mu = 0 \,.$$ First, by splitting $f$ into positive and negative part, we can suppose without loss of generality that $f \ge 0$. Suppose that $(1)$ does not hold, then $$ \limsup_{n \to \infty} \int_{B_{n+1} \setminus B_n} f \, d\mu := L > 0 \,,$$ because if $L=0$ then $(1)$ holds. Extract a subsequence $\Lambda \subset \mathbb{N} $ such that $$ \lim_{ \Lambda \ni n \to \infty} \int_{B_{n+1} \setminus B_n} f \, d\mu = L \,,$$ then by the limit definition with $\varepsilon = \frac{L}{2}>0$ there exists $N \in \Lambda$ such that $$ \int_{B_{n+1} \setminus B_n} f \, d\mu > \frac{L}{2} \, , $$ for every $n \in S := \{n \in \Lambda : n \ge N \}$. Then $$ \int_{E} f \, d\mu \ge \sum_{n \in S} \int_{B_{n+1} \setminus B_n} f \, d\mu = \infty \,,$$ but this contradicts $f \in L^1(E)$. Long story short, you are just saying that the general term of a convergent sequence must tend to zero. For sure there's no such result in arbitrary measure space without further structure, as the notion of "going to infinity" is definitely not well defined in a general measure space.