Prove that if $g(x):=0$ for $0 \le x \le \frac{1}{2}$ and $g(x):=1$ for $\frac{1}{2}<x\le 1$, then we have $\int_0^1 g \, dx= \frac{1}{2}$.
I know that I must define a partition $P= \{I_1, I_2, \dots, I_n \}$ of $[0,1]$ and then somehow show that $L(f)=U(f) = \frac{1}{2}$.
I am, however not sure how to do this exactly. Can somebody please help me? I am self-studying this section so I do not have anybody helping me with this.
Hint: Try looking at partitions of the form $\{0,\frac12, \frac12+\epsilon,1\}$ where $\epsilon$ takes on small (less than $\frac12$) positive values.