Let $f: [0,1] \to \mathbb{R}$ be defined by $f(x)=0$ if $x$ is irrational and $f(x) = x+1$ if $x$ is rational. I want to prove using an argument by upper and lower sums that $f$ is not Riemann integrable. I can easily see that $L(f) = 0$, but I'm not sure how to find $U(f)$.
Any hint is appreciated.
If you split the interval $[0,1]$ into $n$ (equal) subintervals, the maximum value of $f(x)$ on the $k$-th interval is $f\bigl(\frac kn\bigr)=\frac kn + 1$, so $$U_n(f)=\frac1n\sum_{k=1}^n\Bigl(\frac kn+1\Bigr)=\frac1n\biggl(\frac{1+2+\dots+n}n +n\biggr).$$ Can you take it from there?