TITLE: $f \in {\mathscr R[a,b]} \implies f $ has infinitely many points of continuity.
QUESTION [12 upvotes]: Claim: If $f \in {\mathscr R[a,b]}$, then $f$ has infinitely many points of continuity. 
1.) I read that it is a corollary of the Lebesgue integrability criterion.  Is it possible to prove the claim without invoking the concept of measure(or using less abstraction) ?  
2.) Here is attempt: Given $\epsilon > 0, \exists$ Partition, $P =  \left\{ x_0 =a,...,x_n =b \right\} $ of $[a,b]$ such that $\sum^n_{i=1} (M_i -m_i)\Delta x_i < (b-a)\epsilon$, where  $M_i= \sup \left\{ f(x) : x \in \Delta x_i \right\}$ and $ m_i= \inf \left\{ f(x) : x \in \Delta x_i \right\} $
Let $(M_j -m_j)=\min \left\{ M_i -m_i : i=0,...,n \right\} $. 
$ \implies (M_j-m_j)(b-a) \leq \sum^n_{i=1} (M_i -m_i)\Delta x_i <  (b-a)\epsilon$
$ \implies (M_j-m_j)<\epsilon. $
Let $ c\in (x_{j-1},x_j)$ and $\delta$ be any positive number such that $(c-\delta, c+\delta) \subseteq (x_{j-1}, x_j)$. 
It follows that $ \left| f(x) - f(c) \right| < \epsilon, $ whenever $ \left| x - c \right| < \delta $. 
Since $c$ is arbitrary and $[x_{j-1},x_j]$ is an interval,  there are infinitely many points of continuity.
There is something wrong with my proof since Thomae's function is a counterexample. Could anyone point out the mistakes in my proof? Thank you.

REPLY [2 votes]: Without loss of generality, we'll work with $[0,1]$. 

LEMMA 1 Suppose that $$U(P,f)-L(P,f)<\frac{1}n$$ for some partition $P$ and natural number $n$. Then there exists $i$ such that $M_i-m_i<\frac 1 n$.

P If not, we would have $$U(P,f)-L(f,P)=\sum_{i=1}^m (M_i-m_i)\Delta x\geqslant\frac 1 n\sum_{i=1}^m \Delta x=\frac 1 n$$
contrary to our hypothesis.

THEOREM If $f\in{\mathscr R}[0,1]$, then $f$ is continuous at infinitely many points of $[0,1]$, moreover, this set is everywhere dense in $[0,1]$.

P Pick a partition $P_1=\{t_1,t_2,\ldots,t_n\}$ such that $U-L<1$. Then there exists an $i$ for which $M_i-m_i<1$. If $i\neq 1,n$; choose $a_1=x_{i-1},b_1=x_i$. Else, choose $a_1\in(0,t_1)$ or $b_1\in (t_{n-1},b)$ (if $i=1$ or $i=n$, resp.). Then $$\sup_{x\in [a_1,b_1]} f(x)<1$$
Since $f\in{\mathscr R}[a_1,b_1]$, we may repeat the procesto obtain $a_1<a_2<b_2<b_1$ such that $\sup_{x\in [a_2,b_2]} f(x)<\frac 1 2$. Continuing the process, we obtain a sequence of nested closed intervals $I_n=[a_n,b_n]$ such that $$(\sup-\inf)\{f:I_n\}<\frac 1 n$$
By Cantor's theorem there exists $\xi\in \bigcap_{n\geqslant 1}I_n$. In particular, since $a_n<a_{n+1}<b_{n+1}<b_n$, we have $\xi\neq a_i,b_i$. (Ex. Show $f$ is continuous at $x=\xi$.) Now, $f$ is integrable on $[0,\xi]$, $[\xi,1]$, so we may repeat the process to obtain $\xi_1,\xi_2$ two different points of continuity. By construction, $\xi_1,\xi_2\neq \xi,0,1$. We may continue this process to obtain, for each $j$, $2^{j+1}-1$ points of continuity. Thus this set is infinite.
Pick now $x\in[0,1]$, and consider  $\left[x,x+\dfrac 1{2^n}\right]$ (the argument should be slightly modified for endpoints. Then for each $n$ we can find by the above construction a point of continuity $\mu_n \neq x$, and it is evident $\mu_n\to x$.