Let $X$ be a sigma finite measure space with $p>0$. The book states the following:
There exists a map $f\in L^{p}(X)$ such that $f>0$ and $f$ is bounded by $1$.
Proof: Let $C_{n}$ be a sequence of disjoint sets of finite measure such that $X$ is the union of these sets. Now just put $f(x) = \left(\frac{2^{-n}}{1+\mu(C_{n})}\right)^{\frac{1}{p}}$ whenever $x \in C_{n}$.
It is pretty clear the boundedness of $f$. How do we show that $f \in L^{p}(X)$ ?
Is it because $\int_{X} f \leq \mu(C_{n}) < \infty$ ?