This is Theorem 1.3 in Stein’s Real Analysis.
If $f$ is integrable on $\mathbb{R}^d$, then $$\lim_{\substack{m(B)\to 0\\ x\in B}}\dfrac{1}{m(B)}\int_B f(y)dy=f(x)~~~{\rm for~a.e.~}x\in \mathbb{R}^d.$$
I wonder if the values of $f$ at those points at which the equality above holds are finite. Or in other words, is the function finite pointwise everywhere at those points? I can give a easy counterexample but I’m not sure if this is the right way to think about it:
Let $f\in L^1(\mathbb{R}^d)$ and $f(x_0)=\infty$. We also have $$\lim_{\substack{m(B)\to 0\\ x_0\in B}}\dfrac{1}{m(B)}\int_B f(y)dy=\infty=f(x_0).$$
This gives a counterexample because in the field of real analysis if the limit is infinity we say the limit exists.
Does my counterexample make sense? If not, could you give me some ideas about my origin question? Thank you!
$f \in L^1(\Bbb R^d)$ and $f(x_0) = \infty$ are not enough to say $$\lim_{\substack{m(B)\to 0\\ x_0\in B}}\dfrac{1}{m(B)}\int_B f(y)dy=\infty$$ even when the $B$ are limited to balls centered at $x_0$. For example $$f(x) = \begin{cases}0 &x \ne 0\\\infty & x = 0\end{cases}$$
To get the limit to be $\infty$, you need a function like $$f(x) =\begin{cases} \infty & x=0\\|x|^{-1/2}&0<|x| < 1\\0&|x|\ge 1\end{cases}$$
And that is also the answer to your question. Neither the function itself nor the limit needs to be finite at the points $x_0$ where the equation holds.