I am currently reading a book and while i was reading I came across an exercise :
Prove that a Banach Space $X$ has finite dimension if and only if every linear subspace of $X$ is closed.
My solution goes like this :
The direction ($\implies$) is immediate since if we have a subspace $F \subseteq X$ then $F$ must be also of finite dimension hence closed.
For the opposite direction I assumed that $X$ has an infinite dimension , then we know that there exist a non trivial linear functional $F:X \to \mathbb{R}$ which is not bounded . Then I proved that $\ker F$ must be dense in $X$ and from hypothesis we have that $\ker F$ is also closed, hence $\ker F=X$ which means that $F$ is trivial and we have a contradiction.
Is this proof correct ? I am asking because I didn't use the hypothesis that $X$ is Banach throughout the proof.
Thanks in advance !