If a function is enclosed by lower and upper sums, does its limit w.r.t. partitions equals the integral Let $a < b$ and denote by $\mathcal P[a,b]$ the set of all finite partitions of the compact interval $[a,b]$, i.e. all sets of the form $P = \{ a = x_0 < x_1 < \ldots < x_n = b \}$. Suppose we have given a function $f : [a,b] \to \mathbb R$ which is Riemann-integrable and suppose we have some function $g : \mathcal P[a,b] \to \mathbb R$, and suppose for each partition $P = \{ a = x_0 < x_1 < \ldots < x_n = b \}$ we have
$$
  \sum_{i=1}^n \left( \inf_{s \in [x_i, x_{i-1}]} f(s) \right) \cdot (x_i - x_{i-1})
 \le 
 g(P) 
 \le
 \sum_{i=1}^n \left( \sup_{s \in [x_i, x_{i-1}]} f(s) \right) \cdot (x_i - x_{i-1}).
$$
For a partition $P$ set $\Delta(P) := \max_{i=1,\ldots, n} (x_i - x_{i-1})$, i.e. the ''fineness'' of the partition, then does the above imply
$$
 \lim_{\Delta(P) \to 0} g(P) = \int_a^b f \, dx
$$
where the integral is the Riemann-integral?
 A: Yes, the inequality implies
$$\lim_{\Delta(P)\to 0} g(P) = \int_a^b f(x)\,dx.$$
Recall that a bounded function $f\colon [a,b] \to \mathbb{R}$ is Riemann integrable over $[a,b]$ with integral $I$ if and only if for every $\varepsilon > 0$ there is a $\delta > 0$ such that for every partition $P = \{a = x_0 < x_1 < \dotsc < x_n = b\}\in \mathcal{P}[a,b]$ with $\Delta(P) \leqslant \delta$ we have
$$\biggl\lvert I - \sum_{i = 1}^n f(\xi_i)\cdot (x_i - x_{i-1})\biggr\rvert \leqslant \varepsilon,$$
where for every $i$ we have $\xi_i \in [x_{i-1},x_i]$.
Taking the supremum resp. infimum over all possible choices of the points $\xi_i$, we obtain that for every partition $P = \{a = x_0 < x_1 < \dotsc < x_n = b\}$ with $\Delta(P) \leqslant \delta$ we have
$$I - \varepsilon \leqslant \sum_{i = 1}^n \biggl(\inf_{s\in [x_{i-1},x_i]} f(s)\biggr)\cdot (x_i - x_{i-1}) \leqslant g(P) \leqslant \sum_{i = 1}^n \biggl(\inf_{s\in [x_{i-1},x_i]} f(s)\biggr)\cdot (x_i - x_{i-1}) \leqslant I + \varepsilon,$$
so
$$\lvert I - g(P)\rvert \leqslant \varepsilon.$$
