Solution (source code)

= Solution

For a Borel set $A\subset[0,1)$, the two inverse branches of the <doubling map> give the disjoint sets
$$
T^{-1}A=\frac A2\ \cup\ \frac{A+1}{2}.
$$
Each has half the <Lebesgue measure> of $A$, by translation and scaling invariance. Hence \b[$\boxed{\mu(T^{-1}A)=\mu(A)}$]. The piecewise affine map is Borel measurable, so it is a measure-preserving transformation. The printed one-dimensional “baker's map” is this doubling map.