Prove (possibly using the Uniform Boundedness Principle) that g in L^q The question is

Prove that, if $(X, M, \mu)$ is a $\sigma$-finite measure space, $1\leq p\leq\infty$,
  and $\frac{1}{p} + \frac{1}{q} = 1$ then:
If $f: X\rightarrow\mathbb{C}$ is a measurable function such that $fg\in L^1(X,M,\mu)$ for every $g\in L^q
(X,M, µ)$, then $f \in L
^p(X,M, µ)$.

The hint is that it follows "easily" from the Uniform Boundedness principle (I hate intimidating/insulting words like obvious(ly) and easily, but I digress).  I know that, for $1 < p < \infty$, $L^q$ is the dual of $L^p$, but the difficulty (and point which prevents me from applying the UBP) is the fact that the continuity/boundedness of the linear operator $$T_f(g) = \int fg\:dx$$ is not obvious from the hypotheses.  Indeed that fact, which I'm trying to use to prove the conclusion, is equivalent to the conclusion itself, at least for the right values of $p$!
I think I just need a little bit of direction.  I am stuck.
 A: Here is a hint for a proof using the uniform boundedness principle: Since $X$ is $\sigma$-finite, we have $X = \bigcup_n X_n$ with $\mu(X_n) < \infty$ and $X_n \subset X_{n+1}$ for all $n$. Now, define
$$
f_n := f \cdot 1_{X_n} \cdot 1_{\{x :\, |f(x)| \leq n\}}.
$$
Note that $f_n$ is bounded and vanishes outside of a set of finite measure. Hence, $f_n \in L^1 \cap L^\infty \subset L^p$.
Now, let $g \in L^q$ be arbitrary. By assumption, $f \cdot g \in L^1$. Now use the dominated convergence theorem to conclude $\int f_n \cdot g \, d\mu \to \int f \cdot g \, d\mu$.
Finally, use the uniform boundedness principle to conclude that $g \mapsto \int f \cdot g \, d\mu$ is bounded and then conclude $f \in L^p$.

And here is another proof using the closed graph theorem.
For this, consider the map
$$
\Phi : L^q (\mu) \to L^1(\mu), g \mapsto fg .
$$
By assumption, $\Phi$ is well-defined. Show that $\Phi$ has a closed graph using the property that if $g_n \to g$ in $L^q$, then some subsequence converges a.e.

This shows that $\Phi$ is bounded. Thus, so is $f \mapsto \int \Phi(g) \, d\mu = \int f \cdot g \, d\mu$. Now continue as above.
