If $G$ is a linear functional on $L^p$ given by $G(f)=\int fg \,d\mu$ for all $f \in L^p$, then $g \in L^q$ $\textbf{Problem.}$ 

Let $\frac{1}{p} +\frac{1}{q}=1 $,  and let $G$ be a linear functional on $L^p$ given by
  $$G(f)=\int fg \,d\mu $$ for all $f\in L^p$. Show that $g\in L^q$.

I don't know that $g\in L^q$ holds for arbitrary measrue $\mu$. 
If $\mu$ is $\sigma$-finite and $fg\in L^1$, I can prove that $g\in L^q$.
Also if $G$ is bounded, Riesz representation theorem implies that there exist such $g\in L^q$. But I'm having a hard time to prove $G$ is bounded linear functional. 
My professor said that Use Hahn-Banach theorem. How can I use that theorem in this problem? Any help will be appreciated.
 A: The proposition is false. I have constructed a simple counter-example.
Let $(X,\mathcal{M},\mu)$ be a measure space defined by $X=\{x_{0}\}$,
$\mathcal{M}=\{\emptyset,X\}$, and $\mu(\emptyset)=0$, $\mu(X)=\infty$.
Let $p,q\in(1,\infty)$ with $\frac{1}{p}+\frac{1}{q}=1$. It is easy
to observe that $L^{p}:=L^{p}(X,\mathcal{M},\mu)=\{0\}$. Define $g:X\rightarrow\mathbb{R}$
by $g(x_{0})=1$. Note that $G:L^{p}\rightarrow\mathbb{R}$, $G(f)=\int fg\,d\mu$
is a well-defined linear functional because $L^{p}=\{0\}$. However,
$g\notin L^{q}$. Therefore, unless some restriction is imposed, the
proposition is false.
A: If the measure space $(X,\mathcal{M},\mu)$ is $\sigma$-finite, then
the proposition is true. Let me state the proposition and prove it.
Proposition: Let $(X,\mathcal{M},\mu)$ be a $\sigma$-finite measure
space. Let $p,q\in(1,\infty)$ be such that $\frac{1}{p}+\frac{1}{q}=1$.
Let $g:X\rightarrow\mathbb{R}$ be a measurable function. If for each
$f\in L^{p},$$fg\in L^{1}$, then $g\in L^{q}$.
Proof: Since the measure space is $\sigma$-finite, there exists a
sequence of measurable sets $\{A_{n}\mid n\in\mathbb{N}\}$ such that
$A_{1}\subseteq A_{2}\subseteq\ldots$, $X=\cup_{n}A_{n}$ and $\mu(A_{n})<\infty$
for each $n$. For each $n$, define $B_{n}=\{x\mid|g(x)|\leq n$}.
Define $g_{n}:X\rightarrow\mathbb{R}$ by $g_{n}=g1_{A_{n}\cap B_{n}}$.
Note that $|g_{n}|\leq n$ and $\{x\mid g_{n}(x)\neq0\}\subseteq A_{n}$
which has finite measure, so $g_{n}\in L^{q}$. Next, we observe that
$g_{n}\rightarrow g$ pointwisely. For, let $x\in X$ be arbitrary.
Choose $n_{1}$ such that $x\in A_{n_{1}}$. Since $g(x)\in\mathbb{R}$,
there exists $n_{2}$ such that $|g(x)|\leq n_{2}$. For any $n\geq\max(n_{1},n_{2})$,
we have $x\in A_{n}\cap B_{n}$. Therefore $g_{n}(x)=g(x)$ whenever
$n\geq\max(n_{1},n_{2}).$
For each $n$, define $\theta_{n}:L^{p}\rightarrow\mathbb{R}$ by
$\theta_{n}(f)=\int fg_{n}\,d\mu$. By Holder inequality, we have
\begin{eqnarray*}
 &  & \left|\theta_{n}(f)\right|\\
 & \leq & \int|fg_{n}|\,d\mu\\
 & \leq & ||f||_{p}||g_{n}||_{q}.
\end{eqnarray*}
It follows that $\theta_{n}$ is a bounded linear functional on $L^{p}$.
For each $f\in L^{p}$, 
\begin{eqnarray*}
|\theta_{n}(f)| & \leq & \int|fg_{n}|\,d\mu\\
 & \leq & \int|fg|\,d\mu.
\end{eqnarray*}
Therefore 
$$
\sup_{n}|\theta_{n}(f)|\leq\int|fg|\,d\mu<\infty.
$$
Since the family $\{\theta_{n}\mid n\in\mathbb{N}\}$ is pointwisely
bounded, by the uniform boundedness principle, $C:=\sup_{n}||\theta_{n}||<\infty$.
Let $n\in\mathbb{N}$ and $f\in L^{p}$ be given. Define $f_{n}:X\rightarrow\mathbb{R}$
by 
$$
f_{n}(x)=\begin{cases}
f(x), & \mbox{ if }f(x)g_{n}(x)\geq0\\
-f(x), & \mbox{ if }f(x)g_{n}(x)<0
\end{cases}.
$$
Clearly $|f|=|f_{n}|$, so $f_{n}\in L^{p}$. Moreover, $||f||_{p}=||f_{n}||_{p}$.
Now 
\begin{eqnarray*}
 &  & \int|fg_{n}|\,d\mu\\
 & = & \int f_{n}g_{n}\,d\mu\\
 & = & |\theta_{n}(f_{n})|\\
 & \le & C||f_{n}||_{p}\\
 & = & C||f||_{p}.
\end{eqnarray*}
By monotone convergence theorem (or Fatou's lemma), let $n\rightarrow\infty$, then we have
$\int|fg|\,d\mu\leq C||f||_{p}$. Therefore $f\mapsto\int fg\,d\mu$
is a bounded linear functional on $L^{p}$. By Riesz representation
theorem, there exists $g'\in L^{q}$ such that $\int fg\,d\mu=\int fg'\,d\mu$.
That is, $\int f(g-g')d\mu=0$ for any $f\in L^{p}$. Let $D_{1}=\{x\mid g(x)-g'(x)>0\}$,
$D_{2}=\{x\mid g(x)-g'(x)<0\}$. We go to show that $\mu(D_{1})=\mu(D_{2})=0$.
Let $n\in\mathbb{N}$ be arbitrary. Define $f=1_{A_{n}\cap D_{1}}$,
then $f\in L^{p}$ because $\mu(A_{n}\cap D_{1})\leq\mu(A_{n})<\infty$.
Then, $\int_{A_{n}\cap D_{1}}(g-g')\,d\mu=\int f(g-g')\,d\mu=0$.
Since $g-g'>0$ on $A_{n}\cap D_{1}$, it follows that $\mu(A_{n}\cap D_{1})=0$.
(We are using the fact: If $h$ is a measurable function and $A$
is a measurable set, satisfying the condition that $h>0$ on $A$
and $\mu(A)>0$, then $\int_{A}h\,d\mu>0$. ) Now $D_{1}=\cup_{n}(A_{n}\cap D_{1})$,
being a countable union of measure-zero sets, so $\mu(D_{1})=0$.
Similarly, we can prove that $\mu(D_{2})=0$. Hence, $g=g'$ almost
everywhere and therefore $g\in L^{q}$.
