TITLE: Example of a non measurable function!
QUESTION [5 upvotes]: Can we have a measurable function $f$, whose inverse is not measurable?

REPLY [8 votes]: My previous answer is wrong.
Take $f(x) = x$ ($f: \mathbb{R} \to \mathbb{R}$) where the domain has the Borel $\sigma$-algebra and the range the trivial $\sigma$-algebra. Then $f$ is clearly measurable but $f$ maps for example $[0,1]$ to $[0,1]$ which is not measurable.
Or do you want both $\sigma$-algebra's to be Borel? In that case I should modify my first answer (which was wrong because not every subset of a measure zero set is Borel measurable).
Another idea would be the following (based on the one below me): 
Let $g:[0,1] \to \mathbb{R}$ be the Cantor function. Extend it to all of $\mathbb{R}$ by defining $g(x) = 0$ for $x < 0$ and $g(x) = 1$. Now define $h(x) = x + g(x)$ (this is standard), this function has a lot of nice properties like: $h$ is a bijection and measure of $h(C) = 1$ where $C$ is the Cantor set.
Now we know that a set of positive measure contains a non-measurable subset. So let $A$ be an non-measurable subset of $h(C)$. So $M = h^{-1}(A)$ is a subset of the Cantor set and has thus zero Lebesgue measure.
So define $u := h^{-1}$. This function is measurable (Lebesgue/Borel). But $u^{-1}(M) = A$ is non-measurable.