Compactness
Exercise 1.1
Let $X$ be a metric space and $A, B \subseteq X$ be compact. Show that $A \cup B$ and $A \cap B$ are compact.
Exercise 1.2
Let $(X, d)$ be a metric space. If $x \in X$ and $A \subseteq X$ is nonempty and compact, show that there exists an $a \in A$ such that $d(x, a) = d(x, A)$, where $d(x, A) = \inf_{a \in A} d(x, a)$.
Does the conclusion still hold if $A$ is closed instead of compact? (Why or why not?)
Connectedness
Exercise 1.3
Let $X$ be a metric space. Prove that $X$ is connected if and only if the only subsets of $X$ that are both closed and open (i.e., clopen) are $\varnothing$ and $X$.