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
Given any small positive real $\varepsilon > 0$, for any partition $P = \{x_0, x_1, \ldots, x_n\}$ of $[0, 1]$ such that $0 = x_0 < x_1 < \cdots < x_n = 1$, since $\mathbb{Q}$ is dense in $\mathbb{R}$, for each $i$, there exists $q_i \in \mathbb{Q}$ such that $x_i - \varepsilon < q_i < x_i$, it then follows that $$M_i = \sup_{I_i} f(x) - \inf_{I_i} f(x) \geq f(q_{i}) - 0 = q_i > x_{i} - \varepsilon, \quad i = 1, 2, \ldots, n.$$ Therefore, by noting that $x_i = \sum_{j = 1}^{i}(x_j - x_{j - 1})$, we have \begin{align} & U(P, f) \\ = & \sum_{i = 1}^n M_i(x_i - x_{i - 1}) \\ \geq & \sum_{i = 1}^n (x_{i} - \varepsilon)(x_i - x_{i - 1}) \\ = & \sum_{i = 1}^n\left[\sum_{j = 1}^{i}(x_{j} - x_{j - 1})\right](x_i - x_{i - 1}) - \varepsilon \\ = & \sum_{j = 1}^n\left[\sum_{i = j}^n(x_i - x_{i - 1})\right](x_j - x_{j - 1}) - \varepsilon \\ = & \sum_{j = 1}^n (x_n - x_{j - 1})(x_j - x_{j - 1}) - \varepsilon \\ = & 1 - \sum_{j = 1}^n x_{j - 1}(x_j - x_{j - 1}) - \varepsilon \\ \geq & 1 - U(P, f) - \varepsilon. \end{align} Hence $U(P, f) \geq \frac{1}{2} - \frac{\varepsilon}{2}$. Since $\varepsilon$ was arbitrarily small, the result follows.