Use of theorem 3.5 Rudin's Functional Analysis to show simple functions are dense in $L^p$ Can anyone give me a hint for what I thought was an application of the following theorem

Theorem 3.5 (Rudin's Functional Analysis): Suppose $M$ is a subspace of a locally convex space $X$, and $x_0 \in X$. If $x_0$ is not in the closure of $M$, then there exists $\Lambda \in X^*$ such that $\Lambda x_0 = 1$ but $\Lambda x = 0$ for every $x \in M$.

I was trying as example my self to use such theorem to prove that the set of simple functions is dense in $L^p(X,\mu)$. Namely the following theorem

Theorem 3.13 (Rudin's Real and Complex analysis): Let $S$ be the class of all complex, measurable, simple functions on $X$ such that
$$
\mu\left( \left\{ x : s(x) \neq 0 \right\} \right) < \infty
$$
If $1 \leq p < \infty$ then $S$ is dense in $L^p(X, \mu)$.

However I would not now where to start.
 A: Let $1\le p<\infty$. I will use the Riesz representation theorem which usually comes much later than the fact that simple functions are dense. Actually, I think that the usual proof that simple functions are dense in $L^p$ is very instructive so I don't see a reason for showing this in a non-constructive way using a consequence of Hahn-Banach. Anyway, I will also assume that $(X,\mu)$ is a finite measure space for ease.
First of all note that $S$ is a linear subspace, as the scales and sums of simple functions are simple. Now let's assume that $S$ is not dense in $L^p$ so $\bar{S}\neq L^p$. By Hahn-Banach, there exists a functional $\phi\in (L^p)^*$ with $\|\phi\|=1$ and such that $\phi\vert_{\bar{S}}=0$. By the Riesz representation theorem, $\phi$ is of the form $\phi(f)=\int_Xfgd\mu$ for some $g\in L^q$, where $q$ is the conjugate exponent of $p$. We shall show that $g=0$ (in the measure-theory sense, that is, $g=0$ almost everywhere), contradicting that $\phi\ne0$.
Indeed, let $n\in\mathbb{N}$ and take $A:=\{n\ge|g|\ge1/n\}$, this is a measurable subset. Note that $$1_A\le \frac{1}{n}1_A\cdot g$$
In particular,
$$\mu(A)=\int_X1_Ad\mu\le\frac{1}{n}\int_X1_Agd\mu=\frac{1}{n}\phi(1_A)=0$$
since $1_A\in S$.
So, writing $\{g\ne0\}\cap\{|g|<\infty\}=\bigcup_n\{n\ge|g|\ge1/n\}$, we get that $\mu(\{g\ne0\}\cap\{|g|<\infty\})=0$. But as $g\in L^q$, the set $\{|g|<\infty\}$ has full measure and thus $\mu(\{|g|\ne0\})=0$ and thus $g=0$ a.e. and thus $\phi=0$.
A: As I mentioned in my comment, proving density of integrable simple functions $\mathcal{S}$ in $L_p$, $1\leq p<\infty$, via the Hahn-Banach theorem is an overkill for a lot of machinery is required (the Riesz-representation theorem for example, another reason is in the note below).
In any event, as an example, it is probably fine.
Suppose $\Lambda\in (L_p(\mu))^*$ is such that $\Lambda \phi=0$ for all $\phi\in\mathcal{S}$.
For $1<p<\infty$:  Let $g\in L_q(\mu)$, $\tfrac1p+\tfrac1q=1$,  be the representation of
$\Lambda$. Then
$$\int_E g=0$$ for all $E$ with $\mu(E)=0$.
A simple argument then shows that $g=0$ $\mu$=a.s. (the carrier $\{|g|>0\}$ of $g$ is $\sigma$-finite )
For $p=1$: Let $g$ be a locally-essentially bounded functions that represents $\Lambda$. For any $E$ with $\mu(E)<\infty$ and any $\phi\in\mathcal{S}$, $\Lambda(\mathbb{1}_E\phi)=\int_Eg\phi=0$. Procedding as in the case $1<p<\infty$, we conclude that $g=0$ $\mu$-a.s. on $E$. That is, $g$ is locally essentially $0$.

Note: The space  $\mathcal{S}$ is also dense in $L_p(\mu)$ for $0<p<1$. The representation theorem in this case more nuance here. However, the same elementary method (approximating functions by simple functions monotonically along with dominated convergence) that works for $1\leq p<\infty$ also works in this case.
