Exercise :
Let $X$ be a normed space and $Y$ be a proper closed subspace of $X$. If $x_0 \notin Y$, show that there exists $f \in X^*$ such that : $$\|f\| = \frac{1}{d(x_0,Y)}, \; f(x_0) = 1 \; \text{and} \; f(y) = 0$$
Attempt :
I know the following Lemma :
Lemma : Let $(X,\|\cdot\|)$ be a normed space and $Y$ be a proper closed subspace of $X$ with $x_0 \in X \setminus Y$. Then, there exists $f \in S_{X^*}$ such that $f(y) =0$ and $f(x_0) = d(x_0,Y)$.
Using the lemma above for our exercise, I can say that there exists $g \in S_{X^*}$ such that $g(x_0) = d(x_0,Y)$ and $g(y)=0$.
Now, let :
$$f := \frac{1}{d(x_0,Y)}g$$
This means that :
$$f(x_0) = \frac{1}{d(x_0,Y)}g(x_0) = 1 \quad \text{and} \quad f(y) = 0$$
Finally, for the operator norm of $f$ it is $\|g\| = 1$ since $g \in S_{X^*}$, which straightforwardly implies :
$$\|f\| = \frac{1}{d(x_0,Y)}$$
Question : Is my approach correct and rigorous enough ? Other than that easy way out, is there a more standard solution approach ?