Show $\|f-1_{[0,1/2]}\|_{\infty} \geq 1/2$ for any continuous function $f:[0,1] \to \mathbb{R}$ Show that for any continuous map $f$ on $[0,1]$, the indicator map on [$0$,$1/2$] and $f$ has norm difference at least $1/2$.
I have been trying to prove it using the intermediate value property of R,but to no avail.Also I have seen a similar question being discussed in this website,but it gives a solution almost neglecting the "almost everywhere" condition.So I shall highly appreciate if anyone can provide a complete proof of the above statement.Thanks for any help.
 A: Let $f,g: [0,1] \to \mathbb{R}$ be arbitrary functions and $x,y \in [0,1]$. It follows from the (inverse) triangle inequality that
$$\begin{align*} |f(x)-g(x)| &\geq |g(x)-g(y)|- |g(y)-f(x)| \\ &\geq |g(y)-g(x)| - \underbrace{\big| |g(y)-f(y)| - |f(y)-f(x)| \big|}_{\leq |g(y)-f(y)| + |f(y)-f(x)|} \\ &\geq |g(y)-g(x)| - |g(y)-f(y)| - |f(x)-f(y)|. \end{align*}$$
Hence,
$$|g(y)-g(x)| - |f(y)-f(x)| \leq |f(x)-g(x)| + |g(y)-f(x)| \leq 2 \|g-f\|_{\infty}.$$
Now set $g := 1_{[0,1/2]}$ and let $f$ be a continous function. Since $[0,1]$ is compact, $f$ is uniformly continuous, i.e. for any $\varepsilon>0$ we can pick $\delta>0$ such that $$|x-y| < \delta \Rightarrow |f(x)-f(y)| \leq \varepsilon.$$ In particular, if choose $y \in (1/2,1]$ and $x \in [0,1/2]$, $|x-y| < \delta$, we get
$$2 \|g-f\|_{\infty} \geq \underbrace{|g(y)-g(x)|}_{1} - \underbrace{|f(y)-f(x)|}_{\leq \varepsilon} \geq 1- \varepsilon.$$
Since $\varepsilon>0$ is arbitrary, we can let $\varepsilon \to 0$ and obtain
$$2 \|g-f\|_{\infty} \geq 1.$$
A: I think you can go for a bit of an easier proof. Let $a$ be your indicator function and denote by $b(x) = \frac12$ for all $x$, so that $|a(x)-b(x)| = \frac12$ for all $x$. Consider a continuous function $f$ and suppose that $|a(x)-f(x)|<\frac12$ for all $x$, in particular $f\geq b$ on $[0,\frac12]$ and $f\leq b$ on $(0,\frac12]$, but then by intermediate value theorem $f  = b$ at some $\hat x$, hence $|f(\bar x) - a(\bar x)| = \frac12$: contradiction.

It uses intermediate value theorem as I wasn't sure your to no avail means you can't use that, or you can but did not know how.
