This question is Related to Lebesgue differentiation Theorem: Let $f\in L^p(\Bbb R^d)$ $(p\ge 1)$ for $x\in \Bbb R^d$ and $r>0$ we define
$$f_r(x)=\frac{1}{|B(x,r)| }\int_{|B(x,r)|}f(y)dy$$
By Lebesgue differentiation theorem, we know that for almost every, $x\in \Bbb R^d$ $$\lim_{r\to 0}f_r(x)=f(x)$$
My question: How to prove that $$\lim_{|x|\to \infty}f_r(x)=0$$ for $f\in L^p(\Bbb R^d)\cap C^\infty(\Bbb R^d) $
This is less obvious and less intuitive can any help?
I assume $p\geq 1$. Since $f\in L^p$ then for any $\epsilon>0$ there is $R>0$ such that $\lVert f\rVert_{L^p(B_R(0)^c)}\leq \epsilon$. Thus if $\lvert x\rvert>2r+R$ then:
$$\left\lvert\frac 1 {\lvert B(x,r)\rvert}\int_{B(x,r)}fdy\right\rvert^p\leq \left(\frac 1 {\lvert B(x,r)\rvert}\int_{B(x,r)}\lvert f\rvert dy\right)^p\leq\frac 1 {\lvert B(x,r)\rvert}\int_{B(x,r)}\lvert f\rvert^p dy$$
where the last inequality comes from Jensen (as $p\geq1$). But then: $$\lvert f_r(x)\rvert\leq \frac{\epsilon}{\left(\omega_dr^{d}\right)^\frac 1 p}$$ since by assuption $B(x,r)\subseteq B(x,R)^c$. By arbitrariness of $\epsilon$ you get what you want without any regularity assuption.
Note that the bound on $f$ cannot be pushed to the limit as $r\to 0$.
For $0<p<1$ I need some more thinking since it is not even true weak $L^p$ boundness for the Maximal operator.