# If $f$ is continuous at $a$, then $\lim_{r\to 0^+} \frac{1}{\text{vol}(B_r(a))} \int_{B_r(a)} f\, dV=f(a)$.

Let $$R$$ be a rectangle in $$\mathbb{R}^n$$. Let $$f:R\to\mathbb{R}$$ be a bounded, integrable function. Suppose that $$f$$ is continuous at some interior point $$a$$ of $$R$$. Show that $$\lim_{r\to 0^+} \frac{1}{\text{vol}(B_r(a))} \int_{B_r(a)} f\, dV=f(a).$$ Note:

1. $$\int_{B_r(a)} f\, dV$$ is defined as $$\int_{R_1}\bar{f}\, dV$$ for some rectangle $$R_1\supset B_r(a)$$, where $$\bar{f}:\mathbb{R}^n\to\mathbb{R}$$ is defined by $$\bar{f}=f$$ on $$B_r(a)$$ and $$\bar{f}=0$$ otherwise.
2. $$\text{vol}(B_r(a))$$ is defined as $$\int_{B_r(a)}1\,dV$$.

My attempt:

Fix $$\epsilon>0$$. Choose $$\delta>0$$ such that $$|f(x)-f(a)|<\epsilon_1$$ (later defined) for all $$x\in B_\delta(a)\subset R$$. Fix $$r\in(0,\delta)$$. Let $$I:=\int_{B_r(a)}f\, dV$$. For any partition $$P$$ of $$R_1$$, we have $$L(1,P)\le \text{vol}(B_r(a)) \le U(1_, P)$$ $$L(\bar{f},P)\le I\le U(\bar{f},P)$$

Suppose that $$f>0$$ on $$B_\delta(a)$$. Then $$L(\bar{f},P)/U(1, P) \le I/\text{vol}(B_r(a))\le U(\bar{f},P)/L(1,P)$$ We have $$U(\bar{f},P)/L(1,P) = \sum_{Q\in P}\sup(\bar{f}(Q))\text{vol}(Q)/\sum_{Q\in P}\inf(1(Q))\text{vol}(Q)$$.

I do not know how to proceed after expanding the definition.

You don't have to expand into lower and upper sums. Looking at the integral and the triangle inequality suffices. We get $$\left|\frac{1}{\operatorname{vol}(B_r(a))}\int_{B_r(a)}fdV-f(a)\right|=\left|\frac{1}{\operatorname{vol}(B_r(a))}\int_{B_r(a)}fdV-\frac{f(a)\operatorname{vol}(B_r(a))}{\operatorname{vol}(B_r(a))}\right|=$$$$\left|\frac{1}{\operatorname{vol}(B_r(a))}\int_{B_r(a)}f-f(a)dV\right|\leq\frac{1}{\operatorname{vol}(B_r(a))}\int_{B_r(a)}|f-f(a)|dV<$$$$\frac{1}{\operatorname{vol}(B_r(a))}\int_{B_r(a)}\varepsilon dV=\frac{\operatorname{vol}(B_r(a))}{\operatorname{vol}(B_r(a))}\varepsilon=\varepsilon.$$