Continuous functions, monotone functions and bounded functions with finitely many jumps are integrable; Dirichlet's function is not, since every U = b − a and every L = 0.
With the criterion we can sort functions into integrable and not. The big theorem uses uniform continuity: every continuous function on $[a, b]$ is integrable. Jumps are fine in moderation. A function that jumps everywhere is not.
🔑 Key idea
Integrable on $[a, b]$: every continuous function, every monotone function, and every bounded function with finitely many discontinuities. Changing a function at finitely many points does not change its integral. Not integrable: Dirichlet's function ($1$ on rationals, $0$ on irrationals), since every $U = b - a$ and every $L = 0$; and unbounded functions.
💡 Why it works
Continuous functions. Let $\varepsilon > 0$. By uniform continuity there is a $\delta$ with $|f(x) - f(y)| < \frac{\varepsilon}{b - a}$ when $|x - y| < \delta$. Take a partition with all pieces shorter than $\delta$. On each piece the sup and inf are values of $f$ (EVT) at points less than $\delta$ apart, so $M_i - m_i < \frac{\varepsilon}{b - a}$, and $U - L < \frac{\varepsilon}{b - a}\sum \Delta x_i = \varepsilon$. $\blacksquare$ A jump. Put the jump inside one piece of width $w$; every other piece sees a continuous (or constant) function. That one piece contributes at most (size of the jump) $\times\, w$ to $U - L$, which you can make small by shrinking $w$. Dirichlet. Every piece of every partition contains rationals and irrationals (density), so $M_i = 1$ and $m_i = 0$ always: the gap is always $b - a$.
A step function with a jump at $x = 2$: only the piece containing the jump has a gap. Make that piece thinner and the gap disappears.
Worked examples
✏️ Worked example: The gap at a jump
Let $f = 3$ on $[0, 2)$ and $f = 5$ on $[2, 4]$. For $P = \{0, 1.9, 2.1, 4\}$, find $U - L$.
The pieces $[0, 1.9]$ and $[2.1, 4]$ have $M_i = m_i$.
The middle piece $[1.9, 2.1]$ has $M - m = 5 - 3 = 2$ and width $0.2$.
Answer: $U - L = 0.4$. A middle piece of width $w$ gives $2w$, as small as you like.
✏️ Worked example: Dirichlet's function
Let $f = 2$ on the rationals and $f = -1$ on the irrationals in $[0, 3]$. Find $U(f, P)$ and $L(f, P)$ for any partition.
Every piece contains both kinds of numbers: $M_i = 2$ and $m_i = -1$.
Answer: $U = 2 \cdot 3 = 6$ and $L = -3$ for every $P$: not integrable.
Put $x = 1$ inside a tiny piece; it changes $U - L$ by at most about $100 \times$ (its width).
Answer: $\int_0^3 g = \int_0^3 x^{2}\,dx = 9$.
⚠️ Common mistake
Two opposite errors. "Bounded implies integrable" is false (Dirichlet's function). "A function with a jump cannot be integrated" is false too: finitely many jumps cost nothing. The real question is how big the set of discontinuities is. (Lebesgue's criterion: a bounded function is Riemann integrable exactly when its discontinuities form a set of measure zero. Thomae's function, discontinuous at every rational, is integrable with integral $0$.)
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.