Is a function with limits Riemann integrable?

Suppose $f : [ 0, 1 ] → \mathbb{R}$ and $\lim\limits_{x \rightarrow c} f ( x )$ exists for all $c \in [ a , b ]$. Show that $f$ is Riemann integrable on $[ a , b ]$.

I can show this $f$ is bounded on $[a,b]$ since the limit exists at every point. But I'm not sure how to proceed. Any hints or help would be great.


Show that such $f$ with a limit that exists on every point of interval $[a,b]$ is discontinuous in an at most countable set (it is proved here on this site). The main idea is showing that the set $\{x : f(x) \neq g(x)\}$, where $g(y) = \lim_{y \rightarrow x} f(y)$, is at most countable.

Then, apply the Lebesgue criterion to show that the function is integrable since countable sets have measure zero.


Sketch of a more elementary approach: Let $\epsilon > 0.$ For every $x\in [0,1]$ there is an interval $I_x$ centered at $x$ where

$$\sup_{I\setminus \{x\}} f - \inf_{I\setminus \{x\}}< \epsilon/2.$$

The reason we need to remove $x$ from $I_x$ is because $\lim_{\,t\to x} f(t)$ pays no attention to the value of $f$ at $x.$

Because $[0,1]$ is compact, finitely many of these intervals cover $[0,1].$ Let's label them $I_{x_k},$ $k=1,2,\dots n.$ The $x_k$ form a partition of $[0,1],$ but we need to tweak this partition because the values of the $f(x_k)$ could be a bit wild. However, as you noted, $|f|$ is bounded by some $M.$ So for each $k$ we can choose $y_k<x_k<z_k$ very close to $x_k$ and then let $P$ be the partition formed by throwing in all the $x_k,y_k,z_k.$ For this partition, we will have

$$U(f,P)-L(f,P)<\epsilon,$$

which implies $f$ is Riemann integrable on $[0,1].$