1. ## Integrability

Give an example of a function $f:\mathbb R \rightarrow \mathbb R$ such that $f$ is integrable but $f^2$ is not integrable. Prove your result.

Thanks

2. $f(x)=\left\{\left\begin{array}{ll}1 \ \mbox{if }x \in \mathbb{Q}\\-1 \ \mbox{otherwise.}\end{array}$

3. There is a problem with the OP.
There is a theorem (its proof is quite tedious): If $f$ is integrable on $[a,b]$ then $f^2$ is integrable on $[a,b]$.

In the OP the finite interval was not included. So I am not sure what is meant.

However, in the example given by Bruno J $f$ is not integrable but $f^2$ is integrable. The inverse of the OP.

4. This is the definition I know:

$f$ is integrable if $\int|f|< \infty$. Now in Bruno J's example I don't think either $f$ or $f^2$ are integrable since $|f|$and $|f^2|$ are both identically 1 and the integral is not finite.
With regards to Plato's post, well it tells us that we can't use a function integrable on [a,b] since then $f^2$ is going to be integrable. But any function defined on a subset of $\mathbb{R}$ should do. So still thinking.....

5. Originally Posted by Plato
There is a problem with the OP.
There is a theorem (its proof is quite tedious): If $f$ is integrable on $[a,b]$ then $f^2$ is integrable on $[a,b]$.

In the OP the finite interval was not included. So I am not sure what is meant.

However, in the example given by Bruno J $f$ is not integrable but $f^2$ is integrable. The inverse of the OP.
Oops!