Prove that $\inf{U(f,P)}\geq 1/2$ 
Define $f(x)=\begin{cases} x\;\;\;\text{if the point $x\in[0,1]$ is rational}\\ 0\;\;\;\text{if the point $x\in[0,1]$ is irrational} \end{cases}$
Prove that $\inf{U(f,P)}\geq 1/2$.


Let $P=\{x_1,x_2,\cdots,x_i\}$ be a partition of $[0,1]$ with $x_i=\frac{i}{n}$ where $i\geq 1$ and $n\in\mathbb{N}$. By the definition of supremum, $\sup(f(x_i))= x_i$, and for each sub-interval $[x_{i-1},x_i]$ of $[0,1]$, $\Delta_{x_i}=\frac{1}{n}$.
$$U(f,P)=\sum_{i=1}^{n}x_i(x_{i}-x_{i-1})=\sum_{i=1}^{n}\frac{i}{n}\cdot\frac{1}{n} =\frac{1}{n^2}\sum_{i=1}^{n}i=\frac{1}{n^2}\cdot\frac{n(n+1)}{2}=\frac{1}{2}+\frac{1}{2n}$$ Thus, $\inf U(f,P)=1/2$ as $n$ approaches to infinity.

For this question, I choose a particular partition that I can evaluate the upper sum to $1/2$, I thought that is not right since the question is asking for any partitions. Can someone give me a hint or suggestion to write an argument to show for any partition $P$ satisfies $\inf{U(f,P)}\geq 1/2$? Thanks

Let $\mathcal P_0$ be a partition of $[0,1]$. Refine this partition if necessary to a partition $\mathcal P$ containing $n+1$ points so that $x_{i}-x_{i-1}=1/n.\ $Note that $x_0=0$, $x_{n}=1$ and in general $x_i=i/n$.
We have $U(\mathcal P_0)\geq U(\mathcal P)=\frac{1}{n}\sum_{i=1}^{n}f(x_i^{*})$. 
Now let $\epsilon >0$ and choose, using density of the rationals, $x_i^{*}\in [x_{i},x_{i-1}]$ so that $f(x_i^{*})\geq x_i-\epsilon$. 
Then 
$$U(\mathcal P_0)\geq U(\mathcal P)\geq \frac{1}{n}\sum_{i=1}^{n}(x_i-\epsilon)=\frac{1}{n}\sum_{i=1}^{n}x_i-\frac{1}{n}\sum_{i=1}^{n}\epsilon\geq \frac{1}{n}\sum_{i=1}^{n}\frac{i}{n}-\epsilon =\frac{n(n+1)}{2}\frac{1}{n^{2}}-\epsilon > \frac{1}{2}-\epsilon $$
and the result follows.
