Closed and Bounded but not compact Let $(C[0,1];d_{\infty})$ the metric space with $C[0,1]$ the continuous functions on $[0,1]$ and $d_{\infty}(f,g)=\max_{x \in[0,1]}|f(x)-g(x)|$
Prove that $$S=\{f:|f(x)| \leq 1\}$$ is closed and bounded but no compact.
My attempt: I've already proved that is bounded using a ball with radius $2$. But I can't figure out how can I prove that is closed and is not compact, I tried with the limit points and the complement but I'm lost.
 A: It is closed because the uniform limit of continuous functions is continuous, and the limit function will belong to S, because it is also the pointwise limit.
For non-compactness, since we are in a metric space, it is enough to find a sequence in S which (you can show) has no convergent subsequence. $\{x^n\}_{n\geq 1}$ will do the trick.
A: 
Let $X = C([0, 1])$, with $d(f, g) = \sup_{0 \le x \le 1} |f(x) - g(x)|$. Let $B = \{f \in X: d(f, 0) \le 1\}$. Show that $B$ is closed and bounded, but $B$ is not compact.



*

*$B$ is bounded. Set $\|f\| = d(f, 0)$ for $f \in C([0, 1])$. Then $\|f\| \le 1$ for all $f \in B$.

*$B$ is closed. Let $f \in C([0, 1])$ be a limit point of $B$. Then there exists a Cauchy sequence $\{f_n\}$ such that$$\lim_{n \to \infty} d(f_n, f) = 0.$$Then$$\|f\| \le d(f, f_n) + d(f_n , 0) \le d(f, f_n) + 1$$for all $n$. Letting $n$ go to infinity, we get $\|f\| \le 1$. That is, $f \in B$.

*$B$ is not compact. For $n \ge 1$, we define$$g_n(x) = \begin{cases} 1 - nx & \text{if }0 \le x \le {1\over{n}} \\ 0 & \text{if }{1\over{n}} \le x \le 1.\end{cases}$$Then $g_n \in B$. Note that $g_n(x)$ is a decreasing function. Let $m < n$. Then$$g_m(x) - g_n(x) = \begin{cases} (n-m)x & \text{if }0 \le x \le {1\over{n}} \\ 1 - mx & \text{if } {1\over{n}} \le x \le {1\over{m}} \\ 0 & \text{ if} {1\over{m}} \le x \le 1.\end{cases}$$It is clear that$$d(g_m, g_n) = {{n-m}\over{n}} \ge {1\over{m+1}}.$$If $m > n$, then$$d(g_m, g_n) \ge {1\over{n+1}} \ge {1\over{m+1}}.$$This implies that $\{g_1, g_2, \dots\}$ is a bounded closed subset of $C([0, 1])$. Let$$U_0 = C([0, 1]) \setminus \{g_1, g_2, \dots\},$$which is clearly an open set. Also, set$$U_m = \left\{f \in C([0, 1]): d(f, g_m) < {1\over{2(m+1)}}\right\}$$for $m \in \mathbb{N}$. Then$$U_m \cap \{g_1, g_2, \dots\} = \{g_m\}$$and $U_m$ is an open set of $C([0, 1])$. It is clear that $\{U_i: i \ge 0\}$ is an open covering of $B$. But any finite number of $U_i$'s can not cover $B$.

A: For each $n\in \mathbb{N}$,
choose a function $f_n:[0,1]\rightarrow[0,1]$ so that $f$ vanishes off of the closed inteerval $[1/(n+1),1/n]$, $0\le f \le 1$,  and so that $f = 1$ in the middle of the interval.  For all $m$, $n$, 
$$d_{\infty}(f_m, f_n) = 1$$
if $m\not=n$.  This precludes compactness.
A: Closed and bounded follow from the fact that $S = \{ f | d_\infty(f,0) \le 1 \}$.
Let $\phi(f) = \int_0^{1 \over 2} f(x) dx - \int_{1 \over 2}^1 f(x) dx$; it is easy to verify that $\phi$ is continuous.
If $S$ was compact then $\phi$ would have a maximum on $S$. However, we have $\sup_{f \in S} \phi(f) = 1$, but $\phi(f) < 1$ for all $f \in S$. Hence $S$ is not compact.
A: It is closed because if you have a function $f \notin S$ then you have for some $a$ that $|f(a)| > 1$. Now this means that any function $g$ such that $d(g,f) < (|f(x)|-1)/2$ is not in $S$ since $|g(a)| > 1$ by triangle inequality. This shows that $\overline S$ is open and therefore $S$ is closed.
It's not compact since the sequence $f_n = F(x-1)$ has no converging subsequence, where $F(x)=2x$ for $0<x<1/2$, $2-2x$ for $1/2<x<1$ and zero elswhere. It cannot since $d(f_j, f_k) = 1$ for every different $j$ and $k$.    
