Let $[a, b]$ be a finite interval of the real line. A partition $P$ of $[a, b]$ is a finite sequence of numbers of the form
$a = t_0 < t_1 <\cdots < t_{k-1} < t_k = b$
Let $(X, \mu)$ be a measure space. Suppose $\mu(X) < \infty$. Let $f$ be a measurable function on $X$. Suppose $0 \le f(x) \le M$ for every $x \in X$, where $0 < M < \infty$.
Let $P\colon 0 = t_0 < t_1 <\cdots < t_{k-1} < t_k = M$ be a partition of $[0, M]$.
Let $A_i = \{x \in X; t_{i-1} < f(x) \le t_i\} (i = 1,\dots,k)$.
We denote $\sum_{i= 1}^k \mu(A_i)t_{i-1}$ by $s(f, P)$.
We denote $\sum_{i= 1}^k \mu(A_i)t_i$ by $S(f, P)$.
Let $\Phi$ be the set of partitions of $[0, M]$.
Let $s = \sup\{s(f, P); P \in \Phi\}$.
Let $S = \inf\{S(f, P); P \in \Phi\}$.
Is the following proposition true? If yes, how would you prove this?
Proposition
$s = S = \int_X f d\mu$.