Background Information
Let $(X,\mathscr{A},\mu)$ be a measure space, where $\mu$ is $\sigma$-finite. Let $p$ satisfy $1\leq p<+\infty$ and let $q$ be defined by $\frac{1}{p}+\frac{1}{q}=1$. Let $F$ be an arbitrary element of $(L^p(X,\mathscr{A},\mu))^*$.
Notation$\quad$ Suppose that $B$ belongs to $\mathscr{A}$. Let $\mathscr{A}_B$ be the $\sigma$-algebra on $B$ consisting of those subsets of $B$ that belong to $\mathscr{A}$. Let $\mu_B$ be the restriction of $\mu$ to $\mathscr{A}_B$. If $f$ is a real- or complex-valued function on $B$, then we will denote by $f'$ the function on $X$ that agrees with $f$ on $B$ and vanishes outside $B$. The formula $F_B(\langle f\rangle)=F(\langle f'\rangle)$ defines a linear functional $F_B$ on $L^p(B,\mathscr{A}_B,\mu_B)$. In this post I have shown that this functional satisfies $\|F_B\|\leq\|F\|$.
Now let $\{B_k\}$ be a sequence of disjoint sets that belong to $\mathscr{A}$, have finite measure under $\mu$, and satisfy $X=\bigcup_{k=1}^{\infty}B_k$. We know that there is for each $k$ a function $g_k$ in $\mathscr{L}^q(B_k,\mathscr{A}_{B_k},\mu_{B_k})$ that represents $F_{B_k}$ on $L^p(B_k,\mathscr{A}_{B_k},\mu_{B_k})$ and satisfies $\|g_k\|_q\leq\|F_{B_k}\|$. Define $g$ on $X$ so that it agrees on each $B_k$ with $g_k$.
My Question
I want to prove that $g\in\mathscr{L}^q(X,\mathscr{A},\mu)$.
What I Have Tried So Far
We know that for each $k$ there is a function $g_k$ in $\mathscr{L}^q(B_k,\mathscr{A}_{B_k},\mu_{B_k})$ such that for each $\langle f_k\rangle\in L^p(B_k,\mathscr{A}_{B_k},\mu_{B_k})$ we have $$F_{B_k}(\langle f_k\rangle)=\int f_kg_kd\mu_{B_k}$$ and that $\|g_k\|_q\leq\|F_{B_k}\|$. We can write $g$ as $g=\sum_{k=1}^{\infty}g_k\chi_{B_k}=\sum_{k=1}^{\infty}g'_k$. We want to prove that $g\in\mathscr{L}^q(X,\mathscr{A},\mu)$.
Suppose first that $q<+\infty$. Then we want to show that $|g|^q$ is integrable; that is$$\int|g|^qd\mu = \int\left|\sum_{k=1}^{\infty}g'_k\right|^qd\mu < +\infty.$$Since for each $k$ we have $g_k\in\mathscr{L}^q(B_k,\mathscr{A}_{B_k},\mu_{B_k})$ and $\int|g_k|^qd\mu_{B_k}=\int|g'_k|^qd\mu$, it follows that$$\int|g'_k|d\mu = \int|g_k|^qd\mu_{B_k} < +\infty,$$so $g'_k\in\mathscr{L}^q(X,\mathscr{A},\mu)$. Note that we can write $g'_k=g_k\chi_{B_k}$.
I got stuck here, and I don't really know what to do next. I tried to use Beppo-Levi's Theorem as the following, but I didn't get anywhere:
\begin{align*}\int\left|\sum_{k=1}^{\infty}g'_k\right|^qd\mu &= \int\sum_{k=1}^{\infty}|g'_k|^qd\mu\\&= \sum_{k=1}^{\infty}\int|g'_k|^qd\mu\\&= \lim_{n\to\infty}\sum_{k=1}^{n}\int|g'_k|^qd\mu\\&= \lim_{n\to\infty}\int\sum_{k=1}^n|g'_k|^qd\mu.\end{align*}(Note that $\left|\sum_{k=1}^{\infty}g'_k\right|^q=\sum_{k=1}^{\infty}|g'_k|^q$ because the $B_k$'s are disjoint.)
Neither did I successfully showed that $g$ is bounded, which would then means $g\in\mathscr{L}^{\infty}(X,\mathscr{A},\mu)$.
Could someone please help me with the proof? Thank you very much in advance!
Appendix
Beppo Levi's Theorem$\quad$Let $(X,\mathscr{A},\mu)$ be a measure space, and let $\sum_{k=1}^{\infty}f_k$ be an infinite series whose terms are $[0,+\infty]$-valued $\mathscr{A}$-measurable functions on $X$. Then\begin{align*} \int\sum_{k=1}^{\infty}f_kd\mu = \sum_{k=1}^{\infty}\int f_kd\mu.\end{align*}