On showing that the indicator function $f(x) = \begin{cases}1:& x \in (s, t)\\0:& \text{ else }\end{cases}$ is Riemann integrable over $[a, b]$ Let $f(x) = \begin{cases}1:& x \in (s, t)\\0:& \text{ else }\end{cases}$ for $x \in [a, b]$ with $a, b, s, t \in \mathbb{R}, a \leq s < t \leq b$. I have to show that 1.) $f$ is Riemann integrable on $[a, b]$ and 2.) $\int_a^b f = t - s$. Currently I think that I've proven the first step (although it could be more rigorous), but my attempt for the second one is at best handwavy. Therefore I'm asking for any comments/possible improvements for the first and hints/guide for the second.
1.) To show that $f$ is Riemann integrable, we have to show that the upper $U(f, [a, b]) = \inf_{P} U(f, P, [a, b])$ and lower $L(f, [a,b]) = \sup_{P}L(f, P, [a, b])$ Riemann integrals of $f$ over $[a, b]$ coincide, where $P$ is a partition over $[a, b]$ and $U(f, P, [a, b]$ is the upper Riemann summ (resp. lower Riemann sum). To this end, let $\epsilon > 0$ be arbitrary and define a partition $P$ of $[a, b]$ as $x_0 = a, x_n = b$ and $x_i - x_{i-1} = \frac{b - a}{n}$. Choose large enough $n$ such that i.) $\frac{2(b- a)}{n} < \epsilon$, ii.) for some $1 \leq j \leq n$ and $0 \leq k < n$ we have that $x_{j - 1} < s, t < x_{j + k}$ and $s < x_p < t$ for $p = j, j+1,\dots,j-1 + k$.
Then as $U(f, [a, b]) - L(f, [a, b]) \leq U(f, P, [a, b]) - L(f, P, [a, b])$ for any partition $P$ by definition of the upper and lower Riemann integrals, we have that $U(f, [a, b]) - L(f, [a, b]) \leq \sum_{i = 1}^n(x_i - x_{i-1}\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) \Longleftrightarrow$
$U(f, [a, b]) - L(f, [a, b]) \leq \sum_{i = 1}^{j - 1}(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) + \sum_{i = j}^{j + k}(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) + \sum_{i = j + k + 1}^n(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) \Longleftrightarrow $
$U(f, [a, b]) - L(f, [a, b]) \leq \sum_{i = 1}^{j - 1}(x_i - x_{i-1})(0 - 0) + \sum_{i = j}^{j + k}(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) + \sum_{i = j + k + 1}^n(x_i - x_{i-1})(0 - 0) \Longleftrightarrow $
$U(f, [a, b]) - L(f, [a, b]) \leq \sum_{i = j}^{j + k}(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) \Longleftrightarrow $
$U(f, [a, b]) - L(f, [a, b]) \leq (x_j - x_{j-1})(\sup_{[x_{j-1}, x_j]}f - \inf_{[x_{j-1}, x_j]}f) + \sum_{i = j + 1}^{j + k - 1}(x_i - x_{i-1})(\sup_{[x_{i-1}, x_i]}f - \inf_{[x_{i-1}, x_i]}f) + (x_{j + k} - x_{j-1 + k})(\sup_{[x_{j-1 + k}, x_{j + k}]}f - \inf_{[x_{j-1 + k}, x_{j + k}]}f)\Longleftrightarrow $
$U(f, [a, b]) - L(f, [a, b]) \leq (x_j - x_{j-1})(1 - 0) + \sum_{i = j + 1}^{j + k - 1}(x_i - x_{i-1})(1 - 1) + (x_{j + k} - x_{j-1 + k})(1 - 0) = \frac{2(b - a)}{n} < \epsilon$.
Hence we've shown that for any $\epsilon > 0$ there exists a partition such that $U(f, P, [a,b]) - L(f, P, [a, b]) < \epsilon$. Thus $U(f, [a, b]) = L(f, [a, b]$, so that $f$ is Riemann integrable.
Then for the step 2.): As $U(f, [a, b]) = L(f, [a, b]) = \int_a^b f$, we may only consider the upper Riemann integral $U(f, [a, b]) = \inf_P U(f, P, [a, b])$. As $f$ is zero everywhere else except on the open interval $(s, t)$, the upper Riemann sum $(f, P, [a, b])$ is the lower the less the partition intervals $[x_{i-1}, x_i]$ contain anything else from the set $[a, b]\setminus (s, t)$. Therefore the infimum partition will partition the interval $[a, b]$ approximately into three parts: $[a, s], [s, t], [t, b]$, so that the upper Riemann sum will be $0\cdot (s - a) + 1\cdot (t - s) + 0 \cdot (b - t) = t - s$. Hence $\int_a^b f = t - s$.
 A: I can propose an alternative overkill approach that uses the Lebesgue criterion for Riemann integrability. A corollary is that if $S \subset \mathbb{R}$ is bounded, $\chi_S$ is Riemann integrable if and only if the boundary $bS$ has Lebesgue measure 0, or equivalently (since $bS$ is compact), the Riemann upper sum $U(\chi_{bS}) = 0$ (hence $\int \chi_{bS} = 0$).
$f = \chi_{(s, t)}$ is Riemann integrable since $b(s, t) = \{s\} \cup \{t\}$, which can be covered by two intervals of length $\varepsilon$ for any $\varepsilon > 0$.
By linearity of the Riemann integral,
$$t - s = \int_{s}^{t}1 = \int \chi_{[s, t]} = \int \chi_{\{s\}} + \int \chi_{(s, t)} + \int \chi_{\{t\}} = 0 + \int \chi_{(s, t)} + 0.$$
A: Let $P'$ denote the partition $a=x_0 < x_1=s<x_2=t<x_3=b$ of $[0,1]$.
For the partition $P'$ we have $L(f,P',[a,b])=(s-0)\cdot 0+(t-s)\cdot 1+(b-t)\cdot 0=t-s$ and $U(f,P',[a,b])=(s-0)\cdot 0+(t-s)\cdot 1+(b-t)\cdot 0=t-s$ so $L(f,[a,b])\geq L(f,P',[a,b])=t-s$ and $U(f,[a,b])\leq U(f,P',[a,b])=t-s$ (by def. of lower and upper Riemann integrals) but since $L(f,[a,b)\leq U(f,[a,b])$ (lower Riemann integral $\leq$ upper Riemann integral) we have that $t-s\leq L(f,[a,b])\leq U(f,[a,b])\leq t-s$ which implies that $U(f,[a,b])=L(f,[a,b])$ so by def. of Riemann integrability/Riemann integral we have that $f$ is Riemann integrable on $[a,b]$ and $\int_{a}^{b} f=t-s$, as desired. $\square$
