# If the absolute value of a function is Riemann Integrable, then is the function itself integrable?

I am trying to check the converses of a few theorems.

I know that that if $g$ is integrable then $|g|$ is integrable. However, if $|g|$ is Riemann Integrable, then is $g$ Rieman integrable?

I know that if $g$ is integrable then $g^2$ is integrable. However, is the converse true?

I have a hunch that they aren't true, but am failing to device the counter examples.

-

Let $f(x)=1$ when $x$ is rational, $-1$ when $x$ is irrational. Interval say $[0,1]$.
@JacobSchlather: Thanks for the answer. By non-measurable set, do you mean uncountable sets? Also, I was wondering whether you had anything to say about the other question about : know that if $g$ is integrable then $g^2$ is integrable. However, is the converse true? If no, why? – user43901 Jan 31 '13 at 2:11
The example above takes care of your other question, since for the $f$ used in my answer, and Peter L. Clark's, has the property that $f^2=1$. So if you take that as $g$, then $g^2$ is Riemann integrable but $g$ is not. – André Nicolas Jan 31 '13 at 2:14