The converse problem about duality of $L^p$ 
Let $Ω$ be a bounded open subset in $R^n$ and $f$ be measureable with respect to Lebesgue measure on $Ω$. If there exist $M＞0$ s.t.$$\left|\int fg\,\mathrm{d}x\right|≦M\left(\int |g|^q\mathrm{d}x\right)^\frac{1}{q}$$ for all continuous function $g$ on $Ω$ (the integral is on $Ω$), where $1＜q＜+∞$, $\frac{1}{p}+\frac{1}{q}=1$, then $f \in L^p(Ω)$ and $\|f\|_{L^p(Ω)}≦M$.

I find some references: the conclusion is true if $g$ can be substituted by all simple functions.

But how can we do this in the continuous case? Should we choose simple functions that approximate the continuous $g$ by using Lusin's theorem  (but I have some problem in seeing how to do this)? Could someone show me the details? Thank you!

My doubt: even though we can use a continuous $g$ to approximate simple functions in $L^1$ (i.e. in the left side integral), we need that to prove they are close enough also in $L^q$ (i.e. in the right side integral).
 A: $\newcommand\ds\displaystyle$
Since continuous functions with compact support are dense in $L^q(\Omega)$, the inequality
$$\label{1}\tag{1}
\bigg|\int_\Omega fg\bigg|\leq M\,\|g\|_q$$ holds for all $g\in L^q$ (proof at the end).
Suppose that $\int_\Omega|f|^p=\infty$. Let
$$
X_n=\{|f|\leq n\},\qquad n\in\mathbb N.
$$
Then $\Omega=\bigcup_nX_n$. Write $f(x)=|f(x)|\,e^{i\theta(x)}$. Define
$$
g_n=\frac{e^{-i\theta}\,|f|^{p-1}\,1_{X_n}}{\bigg(\ds\int_{X_n}|f|^p\Bigg)^{1/q}}.
$$
Then
$$
\|g_n\|_q^q=\frac{\ds\int_{X_n}|f|^{q(p-1)}}{\ds\int_{X_n}|f|^p }=1.
$$
And
$$
\int_\Omega f\,g_n=\frac{\ds\int_{X_n}|f|^p}{\bigg(\ds\int_{X_n}|f|^p\Bigg)^{1/q}}=\bigg(\ds\int_{X_n}|f|^p\Bigg)^{1-1/q}=\bigg(\ds\int_{X_n}|f|^p\Bigg)^{1/p}\xrightarrow[n\to\infty]{}\bigg(\int_\Omega|f|^p\Bigg)^{1/p}=\infty,
$$
contradicting your inequality. So $f\in L^p$.

Proof of \eqref{1}. Given $g\in L^q(\Omega)$ there exists a sequence $\{h_n\}$ such that $\|g-h_n\|_q\to0$ (proofs here and here).  Then there exists a subsquence, that we still name $\{h_n\}$ that converges pointwise almost everywhere. Then using Fatou's Lemma,
$$
\bigg|\int_\Omega fg\bigg|=\bigg|\int_\Omega \lim_nfh_n\bigg|\leq\liminf_n\bigg|\int_\Omega fh_n\bigg|\leq\liminf_n M\|h_n\|_q=M\|g\|_q.
$$
The last equality is due to $\big|\|g\|_q-\|h_n\|_q\big|\leq\|g-h_n\|_q$ by the reverse triangle inequality.
A: Abstract: In this article, the norm in $L^p(\Omega)$ space could be descriped by all continuous functions in theorem 1 on $ \Omega $, where  $ \Omega $ is a bounded open set in $\mathbb{R} ^n$, $1<p<\infty$. This could be regard as the converse problem for H{"o}lder inequality.
Theorem 1. $ \Omega $ is a bounded open set in $\mathbb{R} ^n$, $1<q<\infty$, $f$ is Lebesgue measurable on $ \Omega $. If there exist a $M>0$ s.t.
\begin{equation}
 |\int_{\Omega} fgdx|\leq M(\int_{\Omega} |g|^qdx)^\frac{1}{q} 
\end{equation}
then, $f\in L^p(\Omega)$,  $||f||_p \leq M$, where $\frac{1}{p}+\frac{1}{q}=1$ and $||\;||_p$ denote the norm in $L^p(\Omega)$
Proof:
Claim 1. if the continuous funtion  could be sbustituted by all integrable simple functions in (1), then the results hold . We can get it from reference 1.
Claim 2. $|x^p-y^p|\leq p|x-y|(x^{p-1}+y^{p-1})$ when $1<p<\infty$, Real and Complex Analysis Rudin's book in chapter 3, problem 24.
We only need to show
\begin{equation}
  |\int_{\Omega} fhdx|\leq M(\int_{\Omega} |h|^qdx)^\frac{1}{q} 
 \end{equation}
for all integrable simple function $h$ by claim 1. Thus we only need to prove the inequality (2).
case 1.   $\int_{\Omega} |f|=0$, (2) is trivial.
case 2.   $\int_{\Omega} |f|\neq0 $
for any $\epsilon >0$, we choose a bounded continuous function $g$.(Choose a real number $G$ s.t. $h,g$ are bounded by $G$) s.t.$\int_{\Omega}|h-g|^qdx<2\epsilon$
Claim 3. $ \int _{\Omega}|f(h-g)|dx<\epsilon$
We have $\int_{\Omega}|h^p-g^p|dx<4p\epsilon G^(p-1)$ by Claim 2.
Now we have
$$|\int_{\Omega} fhdx|\leq M(\epsilon)(\int_{\Omega} |h|^qdx)^\frac{1}{q} $$
and $M(\epsilon)$ is bigger but close enough to $M$ by claim 1.,2.and 3.
Let $\epsilon $ converges to $0$. We  have proved the inequality (2) and complete the proof.
Proof of claim 1.
(I translate the reference into English):
We choose compact supported nonnegative simple measurables function sequence ${\phi_k(x)}$ ($0\leq\phi_1(x)\leq\phi_2\leq...\leq \infty$) s.t. $$ \lim_{k\rightarrow\infty}\phi_k(x)=|f|^p,x\in \Omega$$
Let $\psi_k(x)=(\phi_k(x))^\frac{1}{q} \text{sign} f(x)$,
$$||\psi_k||_q=(\int_{\Omega}\psi_k(x)dx)^{\frac{1}{q}}$$
$$0\leq\psi_k(x)=(\psi_k(x))^{\frac{1}{q}}(\psi_k(x))^{\frac{1}{p}}\leq(\psi_k(x))^{\frac{1}{q}}|f(x)|=\psi_k(x)f(x)$$
So, we have
$$\int_{\Omega}\phi_k(x)dx\leq\int_{\Omega}\psi_k(x)f(x)\leq M||\psi_k(x)||_q$$.
Thus
$$\int_{\Omega}\phi_k(x)dx\leq M^p $$.
After taking the limit, we have
$$\int_{\Omega}|f(x)|^pdx\leq M^p $$.
Proof of claim 2.
$f$ is integrable, then there exist $\delta>0$ s.t. $\int_{E} |f|<\frac{1}{2G}\epsilon$
Then there exist closed $E_{\delta}\subset \Omega$ and $m(\Omega \backslash E_{\delta})<\delta$. The integral on $E_{\delta})$ is dominated by  H{"o}lider inequality.
A: There is a functional analysis proof: Let $F: C_0(\Omega) \rightarrow \mathbb{R}$ be the linear map
$$
F(g) := \int_\Omega fg~\mathrm{d}x.
$$
Because of the given estimate, $F$ is a linear, continuous functional with respect to the $\lVert \cdot \rVert_{L^q(\Omega)}$-norm and $\lVert F \rVert \leq M$. Since $C_0(\Omega)$ is dense in $L^q(\Omega)$, there is a unique continuous, linear extension $\tilde{F} \in L^q(\Omega)'$ such that
$$
\tilde{F}(g) = \int_\Omega f g~\mathrm{d}x 
$$
for all $g\in C_0(\Omega)$ and $\lVert \tilde{F} \rVert \leq M$.
By the characterisation of $L^q(\Omega)'$, there is exactly one $\tilde{f} \in L^p(\Omega)$ with $\lVert \tilde{f} \rVert_{L^p(\Omega)} = \lVert \tilde{F} \rVert \leq M$ such that
$$
\tilde{F}(\zeta) = \int_\Omega \tilde{f}\zeta~\mathrm{d}x
$$
for all $\zeta \in L^q(\Omega)$. Thus
$$
\tilde{F}(g) = \int_\Omega \tilde{f}g~\mathrm{d}x = \int_\Omega fg~\mathrm{d}x
$$
for all $g \in C_0(\Omega)$. Therefore $\tilde{f} = f$ by the fundamental lemma of calculus of variations.
So $f \in L^p(\Omega)$ with $\lVert f \rVert_{L^p(\Omega)} \leq M$.
