Proving that $d(x,\ker f) = \frac{|f(x)|}{\|f\|}$ if $f \in X^*$ Exercise :

Let $(X,\|\cdot\|)$ be a normed space and $V\subseteq X$. The distance of one point $x \in X$ to $V$ is defined by :
  $$d(x,V)=\inf\{\|x-v\|: v \in V\}$$
  Show that if $f \in X^*=B(X,\mathbb R)$ which is the space of the bounded linear functionals, thefe for all $x \in X$ it is :
  $$d(x,\ker f)=\frac{|f(x)|}{\|f\|}$$

Attempt - thoughts :
So, first of all, since $f$ is a bounded linear functional, then there exists some $M>0$ such that :
$$\|f(x)\| \leq M\|x\|$$
Also, the operator norm is given by :
$$\|f\| = \sup\bigg\{\frac{\|f(x)\|}{\|x\|} : x \in X, x \neq 0\bigg\}$$
Now, the kernel of the function $f$ is defined as :
$$\ker f = \{x \in X : f(x) = 0\}$$
Essentialy, we need to calculate :
$$d(x,\ker f) = \inf\{\|x-v\|:v \in \ker f\}$$
Now, of course, the kernel of $f$ is a subspace of $X$ and also, we know that :
$$\text{co}\dim\{\ker f\} = 1$$
I can't see how to combine these facts yielded by the hypothesis of the exercise, though, to continue to an attempted solution.
Any hints, tips or thorough elaborations will be greatly appreciated !
 A: hint: without loss of generality, assume $\|f\|=1$. It is clear that $|f(x)|\le \|v-x\|$ for every $v\in $ker$f$. For the reverse inequality, note that there is a vector $z\in X$ such that $|f(z)|>1-\epsilon$ for any $\epsilon>0.$ For $x\neq 0,\ $ set $v = x-\frac{f(x)}{f(z)} z$ and observe that $v\in $ker$f$.
A: First of all, we can assume for simplicity $\|f\|=1$, by considering $f_1:=\frac1{\|f\|}\cdot f$ instead.
Then $\ker f=\ker f_1$, $\ \|f_1\|=1$, and we have to prove $d(x,\ker f)=|f_1(x)|$ for all $x\in V$.
Assumed $\|f\|=1$, we have $|f(x)|\le \|x\|$, apply it now to vectors $x-v$ with $v\in\ker f$:
$$|f(x)|=\ |f(x-v)|\le\|x-v\|$$ 
which shows $|f(x)|\le d(x,\ker f)$.
For the other direction, by the definition of norm, there are unit vectors $a_1,a_2,\dots$ such that $f(a_n)\ \to 1$.
Now, $y_n:=\ x\ -\ \frac{f(x)}{f(a_n)}a_n\ \in\ker f$, and hence
$$d(x,\ker f)\le\|x-y_n\|\ =\ \frac{|f(x)|}{|f(a_n)|}$$
which tends to $|f(x)|$ as $n\to\infty$.
A: Let $f$ be a nonzero bounded linear functional. If $x\in \ker f$, then there is nothing to prove. So assume that $x\notin \ker f$.
Let $v\in \ker f$. It is clear from the inequality
$$|f(x)|=|f(x-v)|\leq \|f\| \|x-v\|$$
that
$$|f(x)|\leq \|f\|d(x,\ker f).$$
For the converse inequality, it suffices to show that
$$|f(y)|\leq \frac{|f(x)|}{d(x,\ker f)}$$ for all $y$ with $\|y\|=1$ (as $\|f\|=\sup\{|f(y)|\mid \|y\|=1\}$.
If $y\in \ker f$, the inequality is obvious. Otherwise, note that
$$|f(x)|=|f(y)|\left\|x-\left(x-\frac{f(x)}{f(y)}y\right)\right\|.$$
Since $x-\frac{f(x)}{f(y)}y\in\ker f$,
$$\frac{|f(x)|}{|f(y)|}=\left\|x-\left(x-\frac{f(x)}{f(y)}y\right)\right\|\geq d(x,\ker f).$$
Rearranging the above inequality gives the desired conclusion.

The proof given above is adapted from

Hashimoto, Kazuo; Nakamura, Gen; Oharu, Shinnosuke,
Riesz’s lemma and orthogonality in normed spaces, Hiroshima Math. J.
16, 279-304 (1986).
ZBL0606.46012.

