$| \int fg|\leq 1$ for any $g\in C_{0}^{\infty}$, $\|g\|_{L^{2}}=1$ then $\|f\|_{L^{2}}\leq1$ I have the following question:
Let $f$ be a continuous function in an open, bounded, smooth domain $\Omega$ in $\mathbb{R}^{n}$ such that $|  \int_{\Omega} fg|\leq 1$ for any $g\in C_{0}^{\infty}(\Omega)$, $\|g\|_{L^{2}(\Omega)}=1$. Here the measure and the integral are w.r.t. Lebesgue measure.  And $C_{0}^{\infty}(\Omega)$ is the set of smooth functions of compact support in $\Omega$.
Can we conclude that $f\in L^{2}(\Omega)$?
Thanks for any hint.
 A: Consider that 
\begin{align*}
T_{f}:C_{0}^{\infty}\rightarrow\mathbb{C},~~~~g\rightarrow\int fg,
\end{align*}
then by assumption $\|T_{f}(g)\|\leq\|g\|_{L^{2}}$ and hence $\|T_{f}\|\leq 1$. But $C_{0}^{\infty}$ is dense in $L^{2}$, so there is a unique extension $\overline{T}\in(L^{2})^{\ast}$ of $T_{f}$ such that $\left\|\overline{T}\right\|=\|T_{f}\|$. By Riesz Representation Theorem, we have $(L^{2})^{\ast}=L^{2}$ in the sense that a unique $h\in L^{2}$ is such that 
\begin{align*}
\overline{T}(g)=\int hg,~~~~g\in L^{2},
\end{align*}
and that $\|h\|_{L^{2}}=\left\|\overline{T}\right\|$. It follows that $\|h\|_{L^{2}}\leq 1$ and that
\begin{align*}
\int(h-f)g=0,~~~~g\in C_{0}^{\infty}.
\end{align*}
If it were shown to be the case that $h-f=0$ a.e. then we are done.
So the matter is now to show that $\displaystyle\int fg=0$ for all $g\in C_{0}^{\infty}$ will imply that $f=0$ a.e.
First note that the existence of $\displaystyle\int fg$ entails that $\displaystyle\int|fg|<\infty$. For a fixed compact set $K$, take a nonnegative $g\in C_{0}^{\infty}$ such that $g=1$ on $K$, then $\displaystyle\int|fg|\geq\int_{K}|f|$, then $f\in L^{1}(K)$.
On the other hand, for a fixed $x$, we have $\displaystyle\int f(\cdot)\varphi_{\epsilon}(x-\cdot)=0$, where $\varphi_{\epsilon}$ is a standard nonnegative mollifier, the equation is no more than saying that $\varphi_{\epsilon}\ast f(x)=0$. As $\varphi_{\epsilon}\ast f\rightarrow f$ in $L^{1}(K)$, we have $f=0$ a.e. on $K$.
The result follows by considering an exhaustion of compact sets to the whole space.
A: Okay, I seem to have a proof that works assuming that $f\in L^{\infty}_{loc}(\Omega)$ (hence, in particular, if $f\in C(\Omega)$).
Indeed, let $\varphi\in C^{\infty}_0(\Omega)$ and let $(\eta_{\varepsilon})_{\varepsilon\in(0,1]}$ be a (positive) mollifier. Then, since $f\in L^{\infty}(\textrm{supp}(\varphi)),$ we have
$$
\left| \int_{\Omega} f^+ \varphi \right|=\left|\int f \varphi 1_{\{f>0\}}\right|=\lim_{\varepsilon\to 0^+} \left|\int f (\varphi 1_{\{f>0\}} *\eta_{\varepsilon}) \right|\leq \lim_{\varepsilon\to 0^+}||\varphi 1_{\{f>0\}}*\eta_{\varepsilon}||_2=||\varphi 1_{\{f>0\}}||_2\leq ||\varphi||_2,
$$
where we use that $\varphi 1_{\{f>0\}} *\eta_{\varepsilon}\in C_0^{\infty}(\Omega)$ for $\varepsilon$ sufficiently small (we extend by $0$ to $\mathbb{R}^n$ when defining the convolution). We get that $f^{+}$ and, similarly, $f^{-}$ must satisfy the same property.
Hence, we can assume that $f$ is positive. Let $(K_n)_{n\in \mathbb{N}}$ be an exhaustion of $\Omega$ by compacts and let $f_n=f1_{K_n}.$ Then, $f_n\in L^{\infty}(K_n)\subseteq L^{2}(K_n)$ and
$$
||f_n||_{L^2}^2= \int f_n^2=\lim_{\varepsilon\to 0^+} \int f_n (f_n*\eta_{\varepsilon})\leq \limsup_{\varepsilon\to 0^+} \int f (f_n*\eta_{\varepsilon})\leq \lim_{\varepsilon\to 0^+} ||f_n*\eta_{\varepsilon}||_{L^2}=||f_n||_{L^2},
$$
implying that $||f_n||_{L^2}\in [0,1]$. Applying monotone convergence, we get that $f\in L^2(\Omega)$ and $||f||_{L^2}\leq 1.$
