Solution (source code)

= Solution

For a set $M$ of <finite measure> apply the preceding result to $f=\mathbf1_M$. Since its local average minus its point value is bounded in absolute value by its mean absolute oscillation, it gives
$$
\boxed{\frac{\lambda(M\cap(x-r,x+r))}{2r}\longrightarrow\mathbf1_M(x)\quad\text{almost everywhere}.}
$$
For a general measurable $M$, apply the same argument to $\mathbf1_{M\cap[-j,j]}\in L^1(\mathbb R)$. At every interior point of $(-j,j)$, sufficiently short averages agree with those of $\mathbf1_M$. The <countable union> of these interiors covers the line, and a <countable union> of null exceptional sets remains null. This proves \b[the <Lebesgue density theorem> without a finite-<measure> assumption on $M$]. The source's $\chi$ is the indicator of $M$.