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.
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$.