Let $f$ be Lebesgue measurable in $[0,1]$ and assume $f$ takes finitely many values. Assuming $f(x) - f(y)$ is Lebesgue measurable in $[0,1] \times [0,1]$ show that $f$ is integrable over $[0,1]$.
Stuck for a while with this one. (Not homework, just practice)