Define
$$ { f }(x)=\begin{cases} 0\quad ,\quad 0 < x \leq 1 \\ 1\quad ,\quad x=0\end{cases} $$
Note that for any partition $P$ of $[0,1]$, $L(f, P) = 0$, hence $L(f) = 0$. For $U(f)$, let $P = \{x_{0}, x_{1}, ..., x_{n}\}$ be an arbitrary partition of $[0,1]$. Then
$$U(f) = \sum_{i=1}^{n} M_{i}(x_{i}-x_{i-1}) = M_{1}(x_{1} - x_{0}) + \sum_{i=2}^{n} M_{i}(x_{i}-x_{i-1})$$ $$ = 1(x_{1}-0) + 0 = x_{1}.$$
Now how do I go about showing that $U(f) = 0$?
What you have is that $U(f,P)=x_1$. For $U(f)$ you have to take the infimum, which is zero as you can take $x_1$ as close to $0$ as you want.