TITLE: Functions with every point being a Lebesgue point
QUESTION [7 upvotes]: For a locally integrable function $f$ a point $x$ is a Lebesgue point if the integral averages of deviations from $f(x)$ over balls centered at $x$ converge to $0$ as the balls shrink to the point. According to a theorem of Lebesgue almost every point is a Lebesgue point, and obviously every point is Lebesgue if $f$ is continuous. Is the converse true? Are everywhere Lebesgue functions necessarily continuous? 
Such questions usually have a "no" answer but I don't see an obvious counterexample. It's easy to change a continuous function into a discontinuous one at a point, that's still Lebesgue at that point, by altering values on a sequence that converges to it. But that would apparently destroy Lebesgueness at the points of the sequence.

REPLY [9 votes]: Let 
$$f(x) = \sum_{n=1}^\infty (1-4^n|x-2^{-n}|)^+$$
where $a^+=\max(a,0)$. This function consists of triangular spikes of height $1$ at each $x=2^{-n}$, and the width of the spike is $4^{-n}$. It is  continuous on $\mathbb R\setminus \{0\}$, but not at $0$. However, $0$ is a Lebesgue point because 
$$
\int_{-r}^r f(x)\,dx \le  \sum_{2^{-n} \le 2r } 4^{-n} = O(r^2)
$$
(using the fact that the sum of a geometric series is comparable to its largest term.)