Let $f \colon \left[ 0, 1 \right] \to \mathbb{R}$ be defined as $f(x) = x$ if $x \notin \mathbb{Q}$, and $f(x) = 1$ if $x \in \mathbb{Q}$.
Given an arbitrary partition $P = \lbrace x_0, \dots, x_n \rbrace$ of $\left[ 0, 1 \right]$, I've shown that the upper sum, defined as $U(f, P) = \sum \limits_{k=1}^{n} \left( \sup \limits_{x \in \left[ x_{k-1}, x_k \right]} f(x) \right) (x_k - x_{k-1})$ is equal to 1, but I can't seem to find a good expression for the lower sum $L(f, P) = \sum \limits_{k=1}^{n} \left( \inf \limits_{x \in \left[ x_{k-1}, x_k \right]} f(x) \right) (x_k - x_{k-1})$.
I know that at least $L(f, P) \leq 1/2$ but I can't prove it since I can't express lower sums neatly.
On any interval $[x_1, x_2] \subset [0, 1]$, $f$ has minimum $x_1$ if $x_1$ is irrational, and takes values arbitrarily close to $x_1$ if $x_1$ is rational (because you can find irrational numbers arbitrarily close to any rational). This means that $\inf_{x \in [x_1, x_2]} f(x) = x_1$, so the lower sum is $L(f, P) = \sum_{k=1}^n x_{k-1} (x_k - x_{k-1})$.
If you need to prove that this is less than $1/2$, try comparing it to the sum $\sum_{k=1}^n \frac{1}{2} (x_k + x_{k+1}) (x_k - x_{k+1})$. It's not hard to prove that this second sum (a) telescopes, and (b) has every term larger than the corresponding term in $L(f, P)$.