Let $\mathscr{C}[0,1]$ denote the set of continuous functions with bounded supremum and let $K=\{f\in\mathscr{C}[0,1]|\int_0^1f(t)dt=1\}$. Then is $K$ compact in the space $\mathscr{C}[0,1]$? Typically how do we characterize the compact spaces in the space of continuous functions? Will Heine-Borel property work here?
I think Heine-Borel would work, as $[0,1]$ is a compact Hausdorff space. Then, by using a function similar to spikes, or, somewhat like Dirac-Delta function, I think the space $K$ is not compact. Is my argument true? Any hints? Thanks beforehand.
Consider the sequence $(f_n)_n$ given by $f_n(x) = 1+n\sin(2\pi x)$. We have $(f_n)_n \subseteq K$ but $$\|f_n\|_\infty \ge f_n\left(\frac14\right) = 1+n\sin\left(\frac\pi2\right) = 1+n $$
Hence $K$ isn't bounded so it cannot be compact.
An alternative argument: define a linear functional $\phi : C[0,1] \to \mathbb{R}$ as $\phi(f) = \int_0^{1/2}f(t)\,dt$. We have that $\phi$ is bounded and hence continuous with respect to the supremum norm.
If $K$ were compact, $\phi|_K$ would be a bounded function. However, for the functions $(f_n)_n$ above we have $$\phi(f_n) = \int_0^{1/2}f_n(t)\,dt = \frac12 + \frac{n}\pi$$ which is a contradiction.