TITLE: Lebesgue measure-preserving differentiable function
QUESTION [10 upvotes]: Let $\lambda$ denote Lebesgue measure and let $f: [0,1] \rightarrow [0,1]$ be a differentiable function such that for every Lebesgue measurable set $A \subset [0,1]$ one has $\lambda(f^{-1}(A)) = \lambda (A)$. Prove that either $f(x) = x$ or $f(x) = 1- x$. 
I will appreciate a hint or a solution that doesn't use ergodic theory as this is an old qual problem in measure theory. $f$ is bounded and continuous and so it is integrable and hence the hypothesis of Lebesgue's Differentiation Theorem are satisfied, but I haven't seen a way to use this or if it is even applicable.

REPLY [7 votes]: First note $f$ is onto: Otherwise the range of $f$ is a proper subinterval $[a,b],$ which implies $\lambda(f^{-1}([a,b])) = \lambda([0,1]) = 1 > b-a = \lambda([a,b]),$ contradiction.
Suppose $f'(x) = 0$ for some $x\in [0,1].$ Then $f(B(x,r))\subset B(f(x),r/4)$ for small $r>0.$ ($B(y,r)$ denotes the open ball with center $y$ and radius $r$ relative to $[0,1].$) Thus for such $r,$ $f^{-1}(B(f(x),r/4))$ contains $B(x,r).$ But $B(f(x),r/4)$ has measure no more than $2\cdot (r/4) = r/2,$ while $B(x,r)$ has measure at least $r.$ That's a contradiction. Hence $f'(x) \ne 0$ for all $x\in [0,1].$
By Darboux, $f'>0$ on $[0,1]$ or $f'<0$ on $[0,1].$  Let's assume the first case holds. Then $f$ is strictly increasing, hence a bijection on $[0,1].$ Thus if $A$ is an interval, $\lambda(A) = \lambda(f^{-1}(f(A)))= \lambda(f(A)).$ Since $f(0) = 0,$ this gives $x = \lambda([0,x]) = \lambda(f([0,x])) = f(x) - f(0) = f(x)$ for all $x\in [0,1].$