Say $f(x)=\begin{cases}1&x\in E\\0&\text{elsewhere}\end{cases}$, where $E=\{1/n:n\in\mathbb{N}\}$.
My main roadblock right now is trying to find a suitable partition for $[0,1]$, where a partition of $[0,1]$ is a set $P=\{x_0,x_1,\dots,x_n\}$, where $0=x_0<x_1<\dots<x_n=1$. The most logical choice would be some variation of the set that was given, $E$, but $1/n$ is decreasing, and $1/n\neq0$, so this doesn't work. How should I partition $[0,1]$? Is there a better way of doing it?
If you're thinking Riemannly: What if your $k^\text{th}$ partition is $\left\{\frac{j}{k^k} \mid 0 \leq j < k^k \right\}$?
If you're thinking Lebesguely: What do you think of $[0,1] = \{0\} \cup \bigcup_{i \in \Bbb{N}} \left( (\frac{1}{i+1},\frac{1}{i}) \cup \{\frac{1}{i}\}\right)$?