TITLE: Riemann Integrability of Step Function
QUESTION [6 upvotes]: Call $f: [a,b] \to \mathbb{R}$ a step function if there exist a partition $P=\{x_0, \ldots, x_n \}$ of $[a,b]$ such that $f$ is constant on the interval $[x_i, x_{i+1})$.
I'm having some issues proving that f is Riemann integrable. If $f$ was defined such that it was constant on the closed interval $[x_i, x_{i+1}]$ then it would be trivial to define a partition such that the supremum and infinum coincide, and the upper and lower sums would cancel. But since we are working with a half-open interval, I'm having issues defining the partitions that will allow me to prove integrability. All proofs I've seen online rely on theorems we haven't proven in class, so I'm assuming I must be missing something simple.

REPLY [2 votes]: This question came to my attention due to a deleted similar question asking about it.  I'm providing a complete answer to this question as well as the other question (which has since been deleted).
Pick a $\delta>0$ and let $Q$ be any partition of $[a,b]$ into intervals such that the maximum length of an interval in $Q$ is less than $\delta$.
Let $|P|$ be the number of intervals in the partition $P$, so $|P|-1$ is the number of jumps in the step function.  Therefore, there are at most $|P|-1$ intervals in $Q$ that contain a jump.  For all of the remaining $|Q|-|P|+1$, $f$ is constant.
Suppose that $\{Q_1,\dots,Q_k\}$ contain jumps of $f$ and $\{Q_{k+1},\dots,Q_n\}$ do not contain jumps.  In this case,
$$
U(Q,f)=\sum_{i=1}^n \max_{x\in Q_i}f(x)\Delta Q_i=\sum_{i=1}^k \max_{x\in Q_i}f(x)\Delta Q_i+\sum_{i=k+1}^n \max_{x\in Q_i}f(x)\Delta Q_i.
$$
Similarly,
$$
L(Q,f)=\sum_{i=1}^n \min_{x\in Q_i}f(x)\Delta Q_i=\sum_{i=1}^k \min_{x\in Q_i}f(x)\Delta Q_i+\sum_{i=k+1}^n \min_{x\in Q_i}f(x)\Delta Q_i.
$$
Since the maximum and minimum coincide for $Q_i$ with $k+1\leq i\leq n$, we have that
$$
\sum_{i=k+1}^n \max_{x\in Q_i}f(x)\Delta Q_i=\sum_{i=k+1}^n \min_{x\in Q_i}f(x)\Delta Q_i.
$$
Therefore,
$$
U(Q,f)-L(Q,f)=\sum_{i=1}^k \max_{x\in Q_i}f(x)\Delta Q_i-\sum_{i=1}^k \min_{x\in Q_i}f(x)\Delta Q_i.
$$
Let $M$ be the maximum value of $f$ and $m$ be the minimum value of $f$ over $[a,b]$. Then
$$
U(Q,f)-L(Q,f)\leq \sum_{i=1}^k M\Delta Q_i-\sum_{i=1}^k m\Delta Q_i.
$$
Since the length of an interval in $Q$ is at most $\delta$, it follows that
$$
U(Q,f)-L(Q,f)\leq kM\delta-km\delta.
$$
Since $k\leq |P|-1$, it follows that
$$
U(Q,f)-L(Q,f)\leq (|P|-1)(M-m)\delta,
$$
which goes to zero as $\delta$ goes to $0$ (as $|P|$, $M$, $m$, and $1$ are all constants).
Therefore, $f$ is Riemann integrable.