Example of a continuous function that is not Lebesgue measurable

Let $\mathcal{L}$ denote the $\sigma$-algebra of Lebesgue measurable sets on $\mathbb{R}$. Then, if memory serves, there is an example (and of course, if there is one, there are many) of a continuous function $f:\mathbb{R}\rightarrow \mathbb{R}$ that is not measurable in the sense that $f:(\mathbb{R},\mathcal{L})\rightarrow (\mathbb{R},\mathcal{L})$ is measurable, but unfortunately, I was not able to recall the example. Could somebody please enlighten me?

Note that this is not in contradiction with the usual "Every continuous function is measurable.", because in this statement it is implicit that the co-domain is equipped with the Borel sets, not the Lebesgue measurable sets.


The standard example is given by the function $g(x)=f(x)+x$, where $f$ is the devil's staircase function of Cantor. It turns out that the function $g$ is a homeomorphism from $[0,1]$ onto $[0,2]$ and has the property that $\mu(g(C))=1$ (where $C$ is the Cantor set). Pick a non measurable $A\subset g(C)$. First note that $B=g^{-1}(A)$ is measurable since $B\subset C$. It follows that $g^{-1}$ is continuous, $B$ is Lebesgue measurable but $(g^{-1})^{-1}(B)$ is non measurable.