I have to check to following sets for compactness in the given spaces with respect to the standard norm for them: \begin{align} M_1 &:= \{f_n:\left[-1, 1\right]\rightarrow \Bbb{R}| f_n(x) = n \cos(nx), n \in \Bbb{N}\} \subset C(\left[-1,1\right]) \\ M_2 &:= \overline{U_2((0,0))} \setminus U_1((1,0)) \subset \Bbb{R}^2 \end{align}
I know from that every compact space is also bounded and closed. From what I understand to check for boundedness of $M \subset X$ there needs to be a $r>0$ and $y \in X$ such that $\forall x \in M: d(x,y)<r$, where $d$ is the metric of $X$. A closed set has limit points of sequence as elements of the set itself; not sure how to check this.
I don't know where to begin with $M_1$ since it's a set of functions given as a subset of a set of infinitely differentiable functions on interval $[-1,1]$ (for which the euclidean norm is ..?).
$M_2$ is supposed to have something to do with infinitely dimensional subspaces or the like, but I don't understand the notation or what it implies; from the lecture I only have $\overline{U_1(0)}= \{x \in V\vert \Vert x \Vert = \sqrt{\langle x,x \rangle } \le 1\}$ which is supposedly an infinitely dimensional euclidean subspace that is a bounded and closed set, but not compact. A compact set $M \subseteq X$ was defined as one, where every sequence has a convergent subsequence with limit in $M$.
The (natural) metric on $C^{\infty}\biggr([-1,1]\biggl)$ comes from the natural Fréchet space structure on it. See here : https://en.wikipedia.org/wiki/Fr%C3%A9chet_space
As for the original question, suppose $M_1$ is compact. Then since we are in a metric space, this implies that $M_1$ is sequentially compact, i.e., any sequence in $M_1$ must have a convergent subsequence. Let $f_{n_k}\to f$ be a convergent subsequence of $f_n$. This implies that $f_{n_k} \to f$ pointwise as well. However, $f_{n_k}(0)=n_k$ which does not converge anywhere. Thus we have a contradiiction.