Let $X$ be a normed space and let $M\subseteq X$ be a maximal subspace. Do we need $M$ to be closed in order to claim that there is a functional $f\in X^*$ such that $\ker f=M$?
I proceeded as follows:
If $M = X$, just take $f=0$.
If not, pick $y\in X\setminus M$ and consider $\langle M\cup\{y\}\rangle$. Then $M\subseteq \langle M\cup\{y\}\rangle\subseteq X$. Since $M$ is maximal, we conclude that $M=\langle M\cup\{y\}\rangle$ or $X=\langle M\cup\{y\}\rangle$. Since $y\notin M$, we have that the only possible option is $X=\langle M\cup\{y\}\rangle$.
Now, since $X$ is closed, $X=\overline{\langle M\cup\{y\}\rangle}$. Thus, if $x\in X$, we can express $x$ as $x=x_0+\alpha y$, where $x_0\in M$ and $\alpha\in\mathbb{R}$.
We now define $f:X\rightarrow\mathbb{R}$ as $f(x)=f(x_0+\alpha y)=\alpha$. Hence, $\ker f=M$ and it is clearly linear.
However, I think I need $M$ to be closed to prove that $f$ is bounded and maybe to claim that the expression $x=x_0+\alpha y$ is unique. So, I want to know if I really need $M$ to be closed or there is another approach to solve the problem in which I don't need this extra hypothesis.
Thank you.
$M$ needs to be closed. Functionals $f \in X^*$ are continuous, so Ker $f$ is closed.