Using Darboux Sums to Prove Upper and Lower Integrals Define $f:[0, 1]\rightarrow\mathbb{R}$ as
\begin{equation}
f (x) \equiv \left\{\begin{array}{l l} 
x & \text{if } x\in [0, 1]\cap \mathbb{Q}\\
0& \text{if }x\in [0, 1]\setminus\mathbb{Q}\end{array}\right.
\end{equation}
Prove that the lower Darboux integral of $f$ on $[0,1]$ is $0$, i.e.
\begin{equation}
\sup\left\{\sum_{i=1}^n (x_i-x_{i-1})\inf_{x\in[x_{i-1}, x_i]}f(x)\ \Big|\  x_0=0, x_n=1, x_i\in(0, 1), n\in\mathbb{N}\right\}=0
\end{equation} and that the upper Darboux integral of $f$ on $[0,1]$ is greater than or equal to 0.5, i.e.
\begin{equation}
\inf\left\{\sum_{i=1}^n (x_i-x_{i-1})\sup_{x\in[x_{i-1}, x_i]}f(x)\ \Big|\  x_0=0, x_n=1, x_i\in(0, 1), n\in\mathbb{N}\right\}\geq\frac{1}{2}
\end{equation}
I think the first part is easy. Let $P=(0, x_1, \dots, x_{n-1}, 1)$ be a partition of $[0, 1]$. Then, by the density of the irrationals in $\mathbb{R}$ there exists an irrational $x\neq0$ in every subinterval $[x_{i-1}, x_i]$ and $f(x)=0$. Consequently,
\begin{equation}
m_i\equiv \inf_{x\in[x_{i-1}, x_i]}f(x)=0\quad\forall \ i=1, \dots, n.
\end{equation} This is true for any partition whence it follows that the lower Darboux sum is zero.
However, I don't really know what to do for the second part. My teacher hinted that we know 
\begin{equation}
x_i \geq \frac{x_i + x_{i-1}}{2}\quad\forall\ i=1, \dots, n,
\end{equation} but I don't see how this is supposed to help... 
(Also, sorry about my inability to format this correctly... Anyone have a link to some beginner instructions on how to format mathematical functions so beautifully? I tried looking stuff up but felt like I only got more and more confused.)
 A: Here's a series of hints as to how to attack this problem. Start with an arbitrary upper Darboux sum given by some partition $\mathcal{P}$. Each piece of the partition is an interval $[x_{i},x_{i+1}]$. What is the supremum of our function on this interval? We would like to say that it is $x_{i+1}$, since that is when the function $g(x) = x$ is biggest on the interval. Our only concern is that maybe $x_{i+1}$ is irrational, and our function is zero there. However, we know that we can find rationals in our interval arbitrarily close to $x_{i+1}$, so you should be able to prove that $x_{i+1}$ is still the supremum of $f$ on our interval, even if it is not the maximum.
Observe that, by the argument of the prior paragraph, every upper Darboux sum for $f$ is actually an upper Darboux sum for the function $g(x) = x$. What can you then say about the relationship between the upper Darboux integrals of $f$ and $g$? What do you know about the upper Darboux integral of $g$ (which is a function whose integral you can explicitly compute!)?
A: When you consider a subinterval $[x_{i-1}, x_i]$, by the fact that the rationals are dense in $\mathbb{R}$, $\sup f([x_{i-1}, x_i]) = x_i$. It may help to visualize a graph of $f(x) = x$ on $[0,1]$ and the upper sum of any partition (consider the portion of the upper sum below the graph; it's always strictly less than the upper sum itself).
