Prove that the infimum is not attained for a set $M$ Consider $C([0,1])$ with the $\sup$-norm. Let 
$$N = \bigg\{ f\in C([0,1]) | \int_0^1 f(x)dx = 0\bigg\}$$
be the closed linear subspace of $C([0,1])$ of functions with zero mean. Let 
$$X = \{ f\in C([0,1]) | f(0) = 0\}$$ and define $M = N\cap X$, meaning that
$$M = \bigg\{ f\in C([0,1]) | f(0) = 0,  \int_0^1 f(x)dx = 0\bigg\}.$$
Also if 
$u\in C([0,1])$ then 
$$d(x,N) = \inf_{n\in N}||u-n|| = |\bar{u}|$$
where $|\bar{u}| = \int_0^1 u(x) dx$ is the mean of u, so the infimum is attained when $n = u-\bar{u}\in N$.
If $u(x) = x\in X$, show that 
$$d(x,M) = \inf_{m\in M} ||u-m|| = \frac{1}{2} $$but that the infimum is not attained for any $m\in M$. 
I was able to show that $d(x,M) = \inf_{m\in M} ||u-m|| = \frac{1}{2}$ but I don't know how to show that its infimum is not attained. I'm not even sure where to start.
Any help and comments would be greatly appreciated. Thank you!
 A: Set $u(x) := x$. Suppose that there exists $m \in C[0,1]$, $m(0)=0$ such that $$\|u-m\|_{\infty} \leq \frac{1}{2}$$ This implies in particular that $$m(x) \geq x- \frac{1}{2}, \qquad \text{for all} \, x \in \left[0,1 \right]$$ Since $m(0)=0$, we can choose $\delta< \frac{1}{2}$ such that $$m(x) > - \frac{1}{4}, \qquad \text{for all} \, x \in [0,\delta]$$ Consequently,
$$\begin{align*} \int_0^1 m(x) \, dx &= \int_0^{\delta} m(x) \, dx + \int_{\delta}^1 \left(x- \frac{1}{2} \right) \, dx \\
&\geq - \frac{1}{4} \cdot \delta + \bigg[ \frac{(x-1/2)^2}{2} \bigg]_{\delta}^1 \\
&= - \frac{1}{4} \delta + \delta - \frac{\delta^2}{2} = \delta \cdot \left( \frac{3}{4}- \frac{\delta}{2} \right) \end{align*}$$
By assumption, $\delta<\frac{1}{2}$, and therefore we find
$$\int_0^1 m(x) \, dx \geq \frac{\delta}{2}>0$$
This shows that there cannot exist $m \in X$ such that $\|u-m\|_{\infty} \leq \frac{1}{2}$ and $\int_0^1 m(x) \, dx =0$.

Actually, the argumentation follows readily from the following picture:
$\hskip2in$ 
The assumption $\|m-u\|_{\infty} \leq 1/2$ means that the function $m$ has to stay in the area between the two dotted lines. In particular, the integral $\int_{\frac{1}{2}}^1 m(x) \, dx$ is (at least) as large as the area marked in orange. In order to compensate it (recall that we are aiming for $\int_0^1 m(x) \, dx =0$), we have to choose $m$ as small as possible (in particular, negative). Obviously, we can only achieve $\int_0^1 m(x) \, dx=0$ if we choose $m(x) = x- \frac{1}{2}$ for $x \leq \frac{1}{2}$. But this function does not satisfy $m(0)=0$. 
