Counterexample that the arbitrary union of compact sets is compact I want to show that it is not true that for any metric space $(X,d)$, the arbitrary union of compact subsets of $X$ is always compact.
For this I use the following counterexample: Consider the metric space $(\mathbb{R},d)$ with $d$ being the euclidean metric. Let $\mathcal{A}=\left\{[a,a]:a\in\mathbb{R}\right\}$, note that every element in $\mathcal{A}$ is a closed and bounded interval, then by the Heine-Borel theorem, each element of $\mathcal{A}$ is compact in this metric space.
Note that $\cup\mathcal{A}=\bigcup_{a\in\mathbb{R}}[a,a]=\mathbb{R}$, which is not compact. Then we found a metric space for which there is an arbitrary union of compact subsets that is not compact.
Is this counterexample right? I'm a bit dubious about the use I'm making of the notion of "arbitrary" union, since I'm not positive that $\mathbb{R}$ is actually an arbitrary index set (since at the end I'm choosing the index set). In other words, I think I'm implying that "arbitrary" and "uncountable" are equivalent notions in this context, fact that I'm not sure of. Thank you!
 A: Your counterexample is correct. "Arbitrary" here means "for any index set", you gave one index set that doesn't work.
A: Others have pointed out rightly about the interpretation of the word "arbitray".
Here is my answer giving varieties of examples of unions not leading to compact sets.
Let me take  indexing set consisting of integers $\ge2$. For such an integer take the closed (bounded interval) $I_n=\big[-\frac{(n-1)}n, \frac{(n-1)}n\big]$. We can easily check that their union is the open interval $(-1,1)$ which is not compact.
Take the same sets $I_n$, this time restrict to the indexing set consisting of prime numbers (or powers of 2, or powers of 3, or those integers with last digit 7). Now the union for each of the indexing set is still the same non-compact $(-1,1)$.
Moral: Indexing set can be any infinite subset of positive integers. The same conclusion is true.
A: Think about this.  In $\mathbb R^n$ a compact set is closed and bounded so we just need to find a union of closed and bounded sets where the union is either not closed or not bounded.
To make a union that is not bounded it is clear we must have an infinite union... but that is all we need.  Say $\cup_{n\in \mathbb N} [n, n+\frac 12]=[0,\frac 12] \cup [1,1\frac 12] \cup [2,2\frac 12] \cup ........$ is closed and unbounded.
To come up with a sample of a union that is bounded but not closed we can have all the "end points" of the compact sets approach a limit point that is not in any of the compact sets.  For example $\cup_{n\in \mathbb N}[\frac 1n, 1] = (0, 1]$ is not closed.
End your example is just jim-dandy too!  If we have a compact set centered an $x \in \mathbb R$ and just do it for every single uncountably many $x \in \mathbb R$ we are going to have included all of $\mathbb R$ and that surely is not compact.
It may be worth trying to prove that any finite union of compact sets is compact.  It's a good exercise.  And not all that trivial.
A: The word "arbitrary" is an informal, and often misleading, terminology. It is usually a reference to the universal quantifier, and in this problem that's exactly what it refers to.
In this case, the statement one wants to disprove (using a counterexample) is the following universally quantified statement:

For any metric space $(X,d)$ and any collection $\{C_i\}_{i \in I}$ of compact subsets of $X$, the union $\bigcup_{i \in I} C_i$ is compact.

And your disproof is perfect, because all you have to do is produce one counterexample, consisting of one metric space and one collection of compact subsets, namely $\mathbb R$ and $\{[a,a] \mid a \in \mathbb R\}$, such that $\bigcup_{a \in \mathbb R} [a,a]$ is noncompact.
