Let I be an interval which contains 0 and let $f(x) = \begin{cases}1, & \text{if $x = 0$} \\0,&\text{if $x \ne 0$}\end{cases}$ which is defined on I.
Proof:
Choose $\epsilon > 0$. Now, let I = $[a,b]$ and let $p \in P_{[a,b]}$. We must show that $U(f,p) - L(f,p) < \epsilon$. Indeed, $L(f,p) = 0$. Without loss of generality, suppose $0 \in p$ such that $0 = x_{i} \in p$. Then, $U(f,p) = (x_{i-1} - x_{i}) + (x_i - x_{i+1}) = (x_{i-1} + x_{i+1}) \le 2(l(p))$ (where $l(p)$ is the length of $p$). Hence, $U(f,p) \le 2 \space inf_{p\in P}l(P) = 0$. So, $U(f,p) - L(f,p) \le 0 < \epsilon$.
I'm mainly worried about the $2 \space inf_{p\in P}l(P) = 0$ part. I know that as the partition become finer, the length of p will approach 0, but I'm not sure if I can say that it equals 0.
You just need to show that for any $\epsilon>0$ there is a partition $P$ such that $U(f,P) < \epsilon$.
Take $P=(0,{1 \over 2}\min(1, \epsilon),1)$, then $U(f,P) = {1 \over 2}\epsilon < \epsilon$.