# Looking for a non-measurable real-valued function with a specific property.

I would like to show that the measurability of the absolute value of a function $g:\mathbb{R} \rightarrow \mathbb{R}$ does not imply that $g$ is measurable (I am convinced that $g$ does not have to be measurable if $|g|$ is).

The only example of a non-measurable set that I have seen is the Vitali set described below:

Define an equivalence relation ~ on $\mathbb{R}$ by $a$~$b$ if $a-b \in \mathbb{Q}$. For each $a\in \mathbb{R}$ we know $[a] \cap (0,1)\not =\emptyset$. $A$ can be shown to be non-measurable, using the axiom of choice.

Is there a way to use $A$ to create such a function $g$? I'm having trouble since my definition of a measurable function requires that the domain of the function be measurable and that one of the sets {${x\in dom(g): g(x)\ge a}$} is measurable (the other 3 sets are obtained by making it a strong inequality and flipping the inequality). Since $A$ isn't even measurable, I'm not sure how to use the only non-measurable set that I have seen.

-

Let $g(x) = 1$ if $x$ is in a fixed non-measurable set $A$ and $g(x)=-1$ otherwise.