[proofplan]
We assume without loss of generality that $f$ is increasing (the decreasing case follows by applying the result to $-f$). For an increasing function on a subinterval, the supremum is attained at the right endpoint and the infimum at the left. This makes the oscillation sum telescope to $\|\mathcal{D}\|(f(b) - f(a))$, which can be made smaller than $\varepsilon$ by choosing a sufficiently fine partition. The [Integrability Criterion](/theorems/193) then gives integrability.
[/proofplan]
[step:Reduce to the increasing case]
Without loss of generality, assume $f$ is increasing on $[a,b]$. If $f$ is decreasing, then $-f$ is increasing; since $f$ is Riemann [integrable](/page/Integral) if and only if $-f$ is, the result for decreasing functions follows.
[/step]
[step:Compute the oscillation sum for an increasing function on a uniform partition]
For any partition $\mathcal{D} = \{x_0, x_1, \ldots, x_n\}$ of $[a,b]$, since $f$ is increasing we have
\begin{align*}
M_j = \sup_{[x_{j-1}, x_j]} f = f(x_j), \qquad m_j = \inf_{[x_{j-1}, x_j]} f = f(x_{j-1}).
\end{align*}
Therefore
\begin{align*}
S(f, \mathcal{D}) - s(f, \mathcal{D}) &= \sum_{j=1}^{n} \bigl(f(x_j) - f(x_{j-1})\bigr)(x_j - x_{j-1}) \\
&\le \|\mathcal{D}\| \sum_{j=1}^{n} \bigl(f(x_j) - f(x_{j-1})\bigr) \\
&= \|\mathcal{D}\| \bigl(f(b) - f(a)\bigr),
\end{align*}
where $\|\mathcal{D}\| = \max_{1 \le j \le n}(x_j - x_{j-1})$ is the mesh size, and the sum telescopes because consecutive terms cancel.
[guided]
Since $f$ is increasing, on each subinterval $[x_{j-1}, x_j]$ the supremum is $M_j = f(x_j)$ (attained at the right endpoint) and the infimum is $m_j = f(x_{j-1})$ (attained at the left endpoint). The oscillation sum therefore becomes
\begin{align*}
S(f, \mathcal{D}) - s(f, \mathcal{D}) = \sum_{j=1}^{n}\bigl(f(x_j) - f(x_{j-1})\bigr)(x_j - x_{j-1}).
\end{align*}
Bounding each factor $x_j - x_{j-1}$ by the mesh size $\|\mathcal{D}\| = \max_{1 \le j \le n}(x_j - x_{j-1})$ and pulling it out:
\begin{align*}
S(f, \mathcal{D}) - s(f, \mathcal{D}) \le \|\mathcal{D}\| \sum_{j=1}^{n}\bigl(f(x_j) - f(x_{j-1})\bigr).
\end{align*}
The remaining sum telescopes: each interior value $f(x_k)$ for $1 \le k \le n-1$ appears once with a positive sign (from $j = k$) and once with a negative sign (from $j = k+1$), so all interior terms cancel, leaving
\begin{align*}
\sum_{j=1}^{n}\bigl(f(x_j) - f(x_{j-1})\bigr) = f(x_n) - f(x_0) = f(b) - f(a).
\end{align*}
[/guided]
[/step]
[step:Choose the mesh size to satisfy the integrability criterion]
Given $\varepsilon > 0$, if $f(b) = f(a)$ then $f$ is constant and the oscillation sum is zero for any partition. Otherwise, choose a partition $\mathcal{D}$ with mesh size
\begin{align*}
\|\mathcal{D}\| < \frac{\varepsilon}{f(b) - f(a)}.
\end{align*}
(For example, take the uniform partition with $n$ subintervals where $n > \frac{(b-a)(f(b)-f(a))}{\varepsilon}$.) Then by the estimate from the previous step:
\begin{align*}
S(f, \mathcal{D}) - s(f, \mathcal{D}) \le \|\mathcal{D}\|\bigl(f(b) - f(a)\bigr) < \varepsilon.
\end{align*}
By the [Integrability Criterion](/theorems/193), $f$ is Riemann integrable on $[a,b]$.
[/step]