Simple Riemann Integrability Question I would like to show that for $a\leq s < t\leq b$, the function
$$f(x) = \begin{cases}
1,\,&\mbox{ if }s<x<t;\\
0,\,&\mbox{ otherwise}
\end{cases}$$
is Riemann-integrable on $[a,b]$ and that this integral has value the $t-s$.
So far, my line of thinking has been to let $P$ be a general partition $a = x_{0}<x_{1}<\ldots<x_{n} = b$, take $M,N$ to be such that $s\in [x_{M-1},x_{M}]$ and $t\in [x_{N-1},x_{N}]$, and then write down the lower- and upper-Riemann sums of the function $f$ on $[a,b]$ depending on whether $s\in (x_{M-1},x_{M})$ or $s \in \left\{x_{M-1},x_{M}\right\}$ (and similarly for $t$).
My question is this: is my line of thinking a good way to approach the problem, and if so, where do I go from here? If my line of thinking is not likely to be productive, please point me in a better direction. Thanks!
 A: Your approach is correct and leads to a correct argument, but another, possibly simpler, argument exists by taking specific partitions and considering their corresponding upper and lower sums.
For example, you can define partitions
$$
Q_n = \{a, s - \frac{1}{2n}, t + \frac{1}{2n}, b\},
\qquad
P_n = \biggl\{a, s + \frac{1}{2n}, t - \frac{1}{2n}, b\biggr\}.
$$
For large enough $n$, these partitions are written in increasing order and
so we have that
\begin{align*}
U(f, Q_n) &= t - s + \frac{1}{n}, \\
L(f, P_n) &= t - s - \frac{1}{n}.
\end{align*}
In this way,
$$
L(f)
\geq \limsup_{n\rightarrow \infty} L(f, P_n)
= \liminf_{n\rightarrow \infty} U(f, Q_n)
\geq U(f)
$$
so that $L(f) = U(f)$ and $f$ is Riemann integrable.
A: Yeah its correct.
The sum will be bounded between $x_N-x_{M-1}$ and $x_{N-1}-x_M$.
As the partition gets finer and finer, we have $x_N, x_{N-1} \to t$ and
$x_M, x_{M-1} \to s$. 
Hence, both of the above tend to $t-s$, and that's the limit!
A: Let $P$ be a partition with $a = x_0, x_1 = s - \epsilon, x_2 = s + \epsilon, x_3 = t - \epsilon, x_4 = t + \epsilon, x_5 = b$.
Let $|f(x) - f(y)|= \Delta_i \quad x_{i-1} \leq x,y \leq x_i$. Now for any refinement $Q \ll P$ with $\underset{\forall i}{\sup} (x_i - x_{i-1})=|| Q || <\delta = \frac{\epsilon}{2}$, we have:
$$|U(Q;f) - L(Q;f)| \leq \sum_{i=1}^5 \Delta_k (x_i - x_{i-1}) = 2\delta = \epsilon$$
So $f \in \mathcal{R}[a,b]$
