The Riesz's Lemma says, if $X$ is a Banach Space with norm $\|\cdot\|$ and $L$ is a closed subspace of $X$, then we have $$ \sup_{f:\|f\|=1} dist(f,L)=1, $$ where $dist(f,L)=\inf_{g \in L} \|f-g\|$.
As claimed by our professor, the following example demonstrates that the supremum might not be achieved in general: let $X=\{f \in C[0,1] \mid f(0)=0\}$ and $L =\{f \in X \mid \int_0^1 f = 0\}$.
I tried to prove this but have not found a clean way to do it, so I want to ask it here to see I could get some hints on this.