Sigma finite and construction of map 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$ ?
 A: Note that $X = \displaystyle \cup_{n=1}^{\infty} C_n$ such that $\mu(C_n) < \infty$. (This is because $X$ is a sigma finite measure space under $\mu$. Also, note that we can choose $C_n$ such that $C_n$'s are mutually disjoint. So, we can assume that $C_i \cap C_j = \phi$. (We need this to define $f(x)$ uniquely. You could of course circumvent this by defining $f$ uniquely on the intersection incase they are not disjoint)
Let $f(x) = (\frac{2^{-n}}{1+\mu(C_n)})^{1/p}$, whenever $x \in C_n$. (If $C_n$'s are not disjoint, define $f$ to be the infimum of $(\frac{2^{-n}}{1+\mu(C_n)})^{1/p}$ on the intersection of the sets). Clearly, $f(x) > 0$ (Since each of the $\mu(C_n) < \infty$). Also, $f(x)$ is bounded above by $1$. (By construction of $f(x)$).
Hence $\int_X |f|^p d\mu = \int_{ \displaystyle \cup_{n=1}^{\infty} C_n} |f|^p d\mu \leq \displaystyle \sum_{n=1}^{\infty} \int_{C_n} |f|^p d\mu = \displaystyle \sum_{n=1}^{\infty} \int_{C_n} (\frac{2^{-n}}{1+\mu(C_n)}) d\mu$
$ = \displaystyle \sum_{n=1}^{\infty} (\frac{2^{-n}}{1+\mu(C_n)}) \mu(C_n) < \displaystyle \sum_{n=1}^{\infty} \frac{1}{2^n} = 1$. 
Thus $f \in \mathcal{L}^p(X)$.
