Let $f$ be a function such that $f(x)=0$ for all $x \in \mathbb{Q}$, and $2^n$ for all $x \in \mathbb{R} \setminus \mathbb{Q}$ where $n$ is the number of zeros immediately after the decimal.
Show that this is measurable.
My first idea here was that since the irrationals are a $G_\delta$ set, they are measurable. There are countably many rationals in $[0,1]$, so that set is also measurable. I suppose this shows that $f$ is measurable.