# Example of a non-integrable function f , such that |f| and f^2 are integrable?

1. Feb 3, 2009

### irresistible

I'm looking for a function
f:[a,b] -> R such that |f| and f2 are integrable on [a,b]
any helps?

2. Feb 3, 2009

To start with, f must be discontinuous (a continuous function on a closed interval is integrable). Can you think of a function f such that f is discontinuous, but |f| (and thus f2 = |f|2) is continuous?

This is really an analysis question, so it really belongs in that forum. :)

Last edited: Feb 4, 2009
3. Feb 4, 2009

### LuisVela

f(x)= 1 for x rational,
-1 for x irational

4. Feb 4, 2009

Don't just give him an answer. ;)

(That's the exact same function I was thinking of, though.)

5. Feb 4, 2009

### LuisVela

I forgot to say: Only if you are dealing with newton or rieman integrals, otherwise f(x) is integrable.

6. Feb 4, 2009

### irresistible

Oh I don't know why I didn't think of that!!
Thank you so much to both of youuuu!