Let $X=(0,1]$ and $f(x)=\dfrac{1}{x^{3/4}}$. Show that $A=\int_X f d\mu$ is finite, but $B=\int_X f^2 d\mu$ is infinite, where the integrals are Lebesgue integrals.
For $B$, I bound the integral below by simple functions, taking the values of $f^2$ at $x=1/n, 2/n, \ldots, 1$. The integral over the simple function is $\dfrac{1}{n}\sum_{i=1}^n \dfrac{1}{(i/n)^{3/2}} = n^{\frac12}\sum_{i=1}^n \dfrac{1}{i^{3/2}}>n^{1/2}$, which goes to $\infty$ as $n\rightarrow\infty$.
What about for $A$? I can't see how to bound the function from above to show that the integral is finite.
To show that a non-negative measurable function is Lebesgue-integrable, we don't need to bound it from above by a simple function. For a measurable $g \geqslant 0$, the Lebesgue integral of $g$ is defined as
$$\int_X g\,d\mu = \sup \left\lbrace \int_X s\,d\mu : s \leqslant g, s \text{ simple}\right\rbrace.$$
$g$ is then called Lebesgue-integrable if $\int_X g \,d\mu < \infty$.
The existence of a simple function with finite integral that bounds $g$ from above is a sufficient, but not necessary condition for the integrability of $g$.
Most of the time it is simpler to show the integrability of a non-negative measurable function by the monotone convergence theorem, however.
In this case, one can use
$$f_n(x) = \begin{cases} 0 &, x < \frac1n\\ f(x) &, x \geqslant \frac1n \end{cases}$$
which is a monotonic sequence of non-negative bounded measurable functions converging pointwise to $f$.
Since $\sup \int_X f_n\,d\mu < \infty$, the monotone convergence theorem implies that $f$ is integrable and
$$\int_X f\,d\mu = \lim_{n\to\infty} \int_X f_n\,d\mu = \sup_{n\in\mathbb{N}} \int_X f_n\,d\mu.$$