Brezis Exercise 3.9
There's a net $(g_i)_i$ in $M^\perp$ such that
$$ \lim_{i} \|f_0-g_i\| = \inf_{g \in M^\perp} \|f_0 - g\|. $$ Because $\|g_i\| \leq \|f_0\| + \|f_0-g_i\|$, $(g_i)_i$ is a bounded net. Then by the Banach-Alaoglu theorem, there exists a convergent subnet $(g_{f(j)})_j$ in the weak* topology. Let $g_0$ be its weak* limit. You already proved that $M^\perp$ is weak* closed, so $g_0 \in M^\perp$. Then we immediately have $$ \|f_0-g_0\| \geq \inf_{g \in M^\perp} \|f_0-g\|. $$ So it's sufficient to prove that $\lvert f_0(x) -g_0(x) \rvert \leq \inf_{g \in M^\perp} \|f_0-g\| \|x\|$ for all $x \in E$. This is easy to show, since for any $x \in E$ we have that $$ \lvert f_0(x) -g_0(x) \rvert = \lim_{j} \lvert f_0(x) -g_{f(j)}(x)\rvert \leq \lim_{j} \|f_0 -g_{f(j)}\| \|x\|. $$