TITLE: $f$ integrable but $f^2$ not integrable
QUESTION [5 upvotes]: At this point in Bartle, $X$ is a nonempty set, $\mathcal{X}$ is a $\sigma$-algebra of subsets of $X$, and $\mu$ is a measure on $\mathcal{X}$. 
$f\in L(X,\mathcal{X},\mu)$ means:

$f:X\to R$ is measurable.
$\int f^+\,d\mu<+\infty$ and  $\int f^-\,d\mu<+\infty$.
$\int f\,d\mu=\int f^+\,d\mu-\int f^-\,d\mu$.

Can someone share a couple of counterexamples:

$f\in L(X,\mathcal{X},\mu)$, but $f^2\not\in L(X,\mathcal{X},\mu)$
$f, g\in L(X,\mathcal{X},\mu)$, but $fg\not\in L(X,\mathcal{X},\mu)$

Thanks.

REPLY [7 votes]: You can find another example through Calculus 2.
Take $f(x) = \frac{1}{\sqrt{x}}$ on $[0,1]$ with Lebesgue Measure.
$\int_0^1 x^{-1/2} dx$ is finite.  You can compute this directly with an improper Riemann integral (that agrees with the Lebesgue integral).  However $$\int_0^1 (f(x))^2 dx = \int_0^1 x^{-1} dx$$ is divergent.
The second example you asked for can be provided through taking $f=g$ as in the other answer to this question.