Here is the question I am trying to solve:
Suppose $f$ is a real-valued function on $\mathbb R$ such that $f^{-1}(c)$ is measurable for each $c.$ Is $f$ necessarily measurable?
Here is the hint I found here Must $f$ be measurable if each $f^{-1}(c)$ is? :
"Hint: Every injective function satisfies the hypothesis. You can take any nonmeasurable set, map it injectively into $(0,\infty)$, and map its complement injectively into $(-\infty,0)$ (for example using $e^x$ for a simple formula)."
My questions are:
1- why every injective function satisfies the hypothesis?
2- And why if I took any nonmeasurable set and map it injectively into $(0,\infty)$, and and map its complement injectively into $(-\infty,0)$ I will get the counter example I want?
Could someone help me answer these questions please?
If $f$ is injective then $f^{-1}(c)$ is either empty (the measure is $0$) or one point (the measure is $0$).
Take a non-measurable subset $T$ of the interval $(0,1)$. Then $S=T\cup [1,2]$ is non-measurable and of cardinality continuum. The latter means there is a bijection $f$ between $S$ and $(0,+\infty)$. Take a bijection $g$ between $\mathbb{R}\setminus S$ and $(-\infty, 0]$. Then the function $h(x)$ which is defined as $g^{-1}(x)$ if $x\le 0$ and $f^{-1}(x)$ if $x>0$, is injective, and so is $h^{-1}$. But $h^{-1}(0,+\infty)=S$ is non-measurable, hence $h^{-1}$ is a function from $\mathbb R$ onto itself such that the preimage of every point is of measure $0$ by the function itself is non-measurable.