I learn the following from the book: Fact: If $g\in L^{1}(\mathbb R),$ then $$\|g\|_{L^{1}(\mathbb R)}=\sup \{ {|\int_{\mathbb R} fg|: f\in L^{\infty}(\mathbb R), \|f\|_{L^{\infty}}}=1\}.$$
We put $C^{\infty}_{c}(\mathbb R)=\{f\in C^{\infty}(\mathbb R): \text{support of } \ f \ \text{is a compact set} \}.$
My Question is:(1) Suppose that $g\in L^{1}(\mathbb R)$. Is it true that, $$\|g\|_{L^{1}(\mathbb R)}=\sup \{ {|\int_{\mathbb R} fg|: f\in C_{c}^{\infty}(\mathbb R), \|f\|_{L^{\infty}(\mathbb R)}=1\}} ?$$ (Bit roughly speaking, can we consider supremum over compactly supporeted $C^{\infty}$ functions rather than essentially bounded functions ($ L^{\infty})$)
(2)Suppose that $g\in L^{q}(\mathbb R), (1\leq q <\infty)$. Is it true that,
$$\|g\|_{L^{q}(\mathbb R)}=\sup \{ {|\int_{\mathbb R} fg|: f\in C_{c}^{\infty}(\mathbb R), \|f\|_{L^{p}(\mathbb R)}=1}\} , (\frac{1}{p}+\frac{1}{q}=1) ?$$
Thanks,
Yes it is true because $C^\infty_c(\mathbb{R})$ is dense in $L^p(\mathbb{R})$ for any $1\leq p<\infty$ in the strong topology and is dense in $L^\infty$ in the weak-$\star$ topology.
Edit: $L^\infty(\mathbb{R})$ is the dual of $L^1(\mathbb{R})$ and $C^\infty_c(\mathbb{R})$ is dense in $L^\infty(\mathbb{R})$. For any $f\in L^1(\mathbb{R})$ then the scalar product $\langle f,g\rangle$ is a continuous linear function on $L^\infty(\mathbb{R})$. If $g\in L^\infty$ but not in $C^\infty_c$ then there exists a sequence $(g_n)$ which converges weakly to $g$ and from the continuity argument we get that $\langle f,g_n\rangle\to\langle f,g\rangle$. We conclude that once we have define a functional on a dense subset we can extend it uniquely to the whole set.