Difference of Lower and Upper Riemann Sums You have a bounded function $h$ that maps the closed interval $[0,1]$ to $\mathbb{R}$. When it comes to its Riemann integrals, it is known that that $\int _{0}^{\overline1}h = 1$ and $\int _{\underline0}^{1}h = 0$.
Is there always a partition such that $U(\alpha,h) - L(\alpha,h) = 1$? Either way, prove also that there is at least one partition $\alpha$ of $[0,1]$ such that $1 \leq U(\alpha,h) - L(\alpha,h) < 1 + \epsilon$ for any $\epsilon > 0$.
While I was able to get the left side of the required inequality, I can't figure out the other half and the next part of the problem. I know that if the function had been Riemann integrable, we would have a partition $\alpha$ such that $\mid U(\alpha,h) - L(\alpha, h) \mid < \epsilon$ but can we use this fact in this problem? If not, how would we go about it?
 A: To show $U(\alpha,h)-L(\alpha,h)<1+\epsilon$ for some $\alpha$ we look at the upper and lower sums, for which we know $inf_{\beta} U(\beta,h)=1$ and $sup_\beta L(\beta,h)=0$.
Since we know the supremum and infimum we can rephrase that to: 
There exists $\alpha$ such that $ U(\alpha,h)\leq\epsilon/2+1$ and $\alpha'$ such that $L(\alpha',h)\leq\epsilon/2 $.
Now we can take a refinement $\alpha''$ that includes both partitions, so both estimates hold. A counterexample could be 
For that partition $\alpha''$ we get $U(\alpha'',h)-L(\alpha'',h)\leq 1+\epsilon$.
For the second part we know that the supremum and infimum doesn't need to exist equivalently such partition doesn't need to exist. 
An counter example is $f:[0,1]\rightarrow \mathbb{R}$ with $x\mapsto 2x$ if x is irrational and $x \mapsto 0$ else. Here $U(\alpha,h)\neq 1$ for all partitions $\alpha$.
A: For each $\epsilon>0$, there exist partitions $\alpha_1, \alpha_2$ such that
\begin{align*}
U(\alpha_1, h) & \leq \overline{\int_0^1} h + \epsilon/2, \\
L(\alpha, h) & \geq \underline{\int_0^1} h - \epsilon/2 .
\end{align*}
Considering $\alpha = \alpha_1 \land \alpha_2$ gets our inequality.
Now for equality, i.e. a function $h$ and a partition $\alpha$ for which $U(\alpha, h) = 1, L(\alpha, h) = 0$, you can consider the case where $h$ is the indicator on $\mathbb{Q}$, i.e.
$$h(x) = \begin{cases} 1 & x \in \mathbb{Q} \\ 0 & x \not \in \mathbb{Q} \end{cases}$$
for any partition $\alpha$.
However, equality won’t always be possible. Consider now $h’$ which is the same as the above $h$, but it takes the value of $2$ at $x = 1/2$ instead of $1$. Then every $U(\alpha, h’)$ will be equal to $1$ plus the length of the interval in $\alpha$ which contains $1/2$.
