TITLE: An alternative proof of an application of Hahn-Banach
QUESTION [6 upvotes]: As a corollary of the Hahn-Banach theorem, we proved that if $M$ is a closed subspace of a normed linear space $X$, $0\neq x_0\notin M$, then $\exists f \in X^*$ such that $f(x_0)\neq 0$ and $f(y)=0$ $\forall y\in M$.
This looked like overkill to me and I tried to give an alternative proof. I may be wrong: so, we can extend $x_0$ to a Hamel basis of $X$, then define $f(x_0)=1,$ zero on the other basis elements and extend linearly, this basically gives $f(\alpha x_0)=\alpha$  on $\text{span}\{x_0\}$ and zero elsewhere. This should give us a bounded linear functional on $X$. Is this correct? Please point out if I am wrong.

REPLY [5 votes]: Rhys and Maksim have both given excellent answers pertaining to the issue of continuity presented by your construction, but I believe it should be pointed out that, even if your construction worked, it would in fact be no less "overkill" than using Hahn-Banach. In the context of foundations your method is even more "overkill". The statement that every vector space has a Hamel basis is in fact equivalent to the axiom of choice over $\mathbf{ZF}$, whereas Hahn-Banach can be proven in $\mathbf{ZF}$ + the ultrafilter theorem, which is a strictly weaker axiom than choice.