the upper Riemann integral is equal to the upper Riemann sum (Analysis 1 by Tao) Proposition 11.3.12. (in Analysis 1 by Tao) Let $f: I \to \mathbb{R}$ be a bounded function on a bounded interval $I$. Then
$$\overline{\int}_If = \inf\{U(f, P): \text{$P$ is a partition of $I$}\}.$$
I know from the previous exercise that 
$$p.c. \int_I g \ge U(f,P),$$
where $g$ is piecewise constant function and majorizes $f$ ($p.c. \int$ denotes the piecewise constant integral). 
In this text, $\overline{\int}_If$ is defined as $\inf\{p.c.\int_I g: \text{$g$ is a piecewise constant function on $I$, and majorizes $f$\}}$, and $U(f, P) = \sum_{J \in P: J\not= \emptyset} (\sup_{x \in J}f(x) |J|)$.
From above, we can easily get $\overline{\int}_If \ge \inf\{U(f, P): \text{$P$ is a partition of $I$}\}.$
But how can we show the opposite inequality? 

Let $P$ be a partition of $I$ and let $U(f, P) = \sum_{J \in P;  J \neq \emptyset} \: (\sup_{x \in J} f(x)) \cdot|J|$. Define a piecewise constant function $g$ with respect to the same partition $P$ where for each non-empty $J \in P$, $g(x) = \sup_{x \in J} f(x)$ for all $x \in J$. Clearly, $g$ majorizes $f$ and so $$\overline\int_{I} f \leq p.c. \: \int_{I} \: g = \sum_{J \in P} \: c_{j} \cdot |J| = \sum_{J \in P;  J \neq \emptyset} \: (\inf_{x \in J} f(x)) \cdot|J| = U(f, P)$$
Therefore, $\overline\int_{I} f$ is a lower bound for $\{U(f, \: P) : P$ is a partition of $I\}$, which means $\overline\int_{I} f  \leq$ inf$\{U(f, \: P) : P$ is a partition of $I\}$. 
