a functional analysis question $X$ is a banach space and $f$ a non zero linear functional. I'm trying to show $null(f)$ not dense in X $\implies f$ continuous. I've tried a few approaches but I think the following seems the most promising:
It suffices to show $f$ is bounded ie. $\exists c>0\::|f(x)|\leq c\|x\|, \forall x\in X$.
Case 1: $x \in null(f)$
then $f(x) = 0$ so choosing $c=1$ the above holds.
Case 2: $x \notin null(f)$ (this is possible since $f$ is nonzero)
This means there is an open ball $B_\epsilon x$ such that $B_\epsilon x$ and $null(f)$ are disjoint (by $null(f)$ not dense in $X$). I'm not quite sure where to go from here. I'm hoping for a hint.
 A: If $null(f)$ is not dense in $X$, you can find $x\in X$ and $r>0$ such that $B(x,r)\cap null(f)=\varnothing$.
if $y\in X$ is such that $|f(y)|\geq|f(x)|$, then for some $\alpha$ with $|\alpha|\leq 1$ we have $f(\alpha y)=f(x)$, so $x-\alpha y\in null(f)$, hence $x-\alpha y\not\in B(x,r)$, so $\Vert y\Vert\geq\Vert\alpha y\Vert\geq r$. What this just said is that
$$|f(y)|\geq |f(x)|\Rightarrow \Vert y\Vert\geq r$$
and its contrapositive is
$$\Vert y\Vert\leq r\Rightarrow|f(y)|\leq |f(x)|.$$
It follows easily that $f$ is continuous and $\Vert f\Vert\leq |f(x)|/r$.
A: Try this:
$null(f)$ is a subspace of $X$ whose codimension is 1. Now if it is not dense, then
$null(f)$ is closed (because its closure is a subspace containing $null(f)$ and it is not $X$). Then you show that it implies continuity.
For example, as $f\neq 0$ there is a $y\in X$ such as $f(y) = 1$.
$$
\{x\in X| |f(x)| = 1 \}= (y + null(f))\cup (-y + null(f))
$$
is closed and does not contain 0, so you can find $r>0$ such as $B(0,r)\subset 
\{x\in X| |f(x)| \neq 1 \}$ and as it is connected:
$$
B(0,r)\subset 
\{x\in X| |f(x)| < 1 \}\\
|x|<r\Rightarrow |f(x)| < 1\\
|x|<1\Rightarrow |f(x)| < \frac1r\\
$$so $f$ is continuous.
