(1) Let $K \subset M_n(\mathbb{R})$ be defined by $$K = \{A \in M_n(\mathbb{R})\mid A = A^T, \ \operatorname{tr}(A) = 1, x^TAx \geq 0 \text{ for all } x \in \mathbb{R}\}$$ Then $K$ is compact.
(2) Let $K \subset C[0, 1]$ (with the usual sup-norm metric) be defined by $$K = \bigg\{f \in C[0, 1]\mid \int_0^1 f(t) \, dt = 1 \text{ and } f(x) \geq 0 \text{ for all } x \in [0, 1]\bigg\}$$ Then $K$ is not compact.
How to prove the above two statements?
For $(1)$ I know that in general the set of positive definite matrices is not closed but what impact does the condition $\operatorname{tr}(A) = 1$ on the compactness?
For $(2)$, how can i utilise Arzela-Ascoli thereom?
One way to look at the first one is to note that the orthogonal matrices are compact, while diagonal matrices with nonnegative diagonal entries summing to $1$ are also compact. This space is more or less the product of those two (specifically, the product of those two and this space are related through a "nice" function). Without the trace requirement, $K$ wouldn't even be bounded.
As for 2, there is a nice easy way to do it, just take a sequence of successively narrower and taller triangular spikes all of which have area 1. Arzela-Ascoli basically just tells you what you can't do, but you don't need to invoke it in the proof.