A linear functional $l$ on a Banach space $B$ is continuous if and only if $\{f \in B : l(f)=0 \}$ is closed . 
Suppose $B$ is a Banach space and $S$ a closed proper subspace , and assume $f_0 \notin S$ .
  (a) Show that there is a continuous linear functional $l$ on $B$ , so that $l(f)=0$ for $f \in S$ , and $l(f_0)=1$ . The linear functional $l$ can be chosen so that $\vert\vert l \vert\vert = \frac{1}{d}$ where $d$ is the distance from $f_0$ to $S$ .
  (b) A linear functional $l$ on a Banach space $B$ is continuous iff $\{f \in B: l(f)=0 \}$ is closed . [Hint: (b) is a consequence of (a) ]  

My attempt:
$$d(f,S)= \inf \{\| f-f_s \| , f_s \in S \}$$ $$p(f)=\frac{d(f,S)}{d(f_0,S)}$$
Let $S_1 = span(S,f_0)$ , and $l(f_0)=1$ , $l(f_s)=0$ $$l(af_0 +bf_s) =al(f_0) +b l(f_s)$$ Then it is obvious that $p(af)=|a|p(f) $ , $p(f_1 + f_2) \le p(f_1) + p(f_2)$ , $|l(f)| \le p(f) $for $a \in C  $ ,$f \in S_1$ and $f_1,f_2 \in S_1$
So By Hahn-Banach , $l$  can be extended from $S_1$ to $B$ , with $|l(f)| \le p(f) \le \frac{\|f\|_B}{d}$ . 
The proof of (a) is complete .
To prove (b) , let $S= \{f \in B: l(f) =0 \}$ , if $S=B$ ,then there's nothing to prove . If $S \neq B$ , WLOG we choose $l(f_0)=1 , f_0 \notin S$ then we denote $l_s$ the functional $l $ restrict on $S$ , and by (a) , $l_s$ has an extention to a continuous functional $l'$ . But I think $l' \neq l$ , and I don't know how to prove (b) then . 

No, you can't have $l'\neq l$. Note that the restrictions of $l$ and $l'$ to $S$  are the same and that $l(f_0)=l'(f_0)=1$. But $B=S\bigoplus\mathbb{R}f_0$, and therefore $l=l'$.
