I know this question sounds silly but I was reading the definition of compactness and couldn't quite wrap my head around this
Compactness :A subset $A$ of a metric space $M$ is compact if every sequence $(a_n)$ in $A$ has a subsequence $(a_{n_k})$ that converges to a limit in $A$
Let $A = [-1,1]$, then a sequence in $A$ is $a_n = (-1)^k$ which oscillates between $-1$ and $1$
Any sequence is a subsequence of itself
$a_n = (-1)^k$ does not converge in $A$, therefore $A$ is not compact
Can someone point out my error please!
It's not silly question. The part you didn't understand is: "has a subsequence"= "has at least one" - that means it is enough to have just one subsequence that converges in $A$, for example $a_{2k}$ but all others don't have to converge, for example sequence $a_k$ as subsequence itself.
Maybe counterexample will help you to understand more:
You can use the same theorem to prove that $B=\langle0,1]$ is not compact since $b_n=(\frac{1}{n})$ is sequence in $B$ which is convergent in $\mathbb{R}$ with limit $0$. And you know that every subsequence of convergent sequence has the same limit, $0$ in this case, and since $0\notin B$ there is no subsequence of $b_n$ that converges in $B$ so $B$ is not compact.