In Pugh's analysis book, why are these metric spaces? Pugh introduces the notion of metric space in chapter 2 as follows

Definition: A metric space is a set $X$ equipped with a metric $d$

Clear!

For example, a metric space is $(\mathbb{R}, |x-y|)$, where $|\cdot|$
  is the absolute value

Super clear!

The following are also metric spaces


What!!!!!??? It is my first time doing analysis...
Can someone please illustrate just for a single example in the above figure as to what the set and the metric would be. For example, what would be the set $X$ and the metric $d$ used in the "closed spiral" figure?
Much thanks!

There are different choices of metrics that make those sets become metric spaces.
The easiest choice for all of them is to consider them as a subset of $\Bbb{R}^2$, and to use the induced metric, e.g. if I let $X$ be the closed spiral, I can let $d$ be the metric given by $d(x,y) = ||x-y||$, where $||x-y||$  is the usual distance in $\Bbb{R}^2$, i.e.
$$||x-y|| = \sqrt{(x_1-y_1)^2+(x_2-y_2)^2}.$$
This choice will work for all the sets, since they can all be considered a subset of $\Bbb{R}^2$.
Another possible choice for the closed spiral $X$ is to let $d(x,y)$ be the shortest distance following the spiral between $x$ and $y$, i.e. the length of the curve segment on the spiral connecting the two points $x$ and $y$.
The moral is that when the author says that these are examples of metric spaces, he should really mention what metrics he has in mind, as a bunch of different metrics are possible on each set.
Edit: You were also asking what the set $X$ is in the closed spiral case. I don't think it's important to describe it in exact terms in this case. You can just make a drawing like the author did, and say that your set $X$ consists of all points on that curve.
Also, it's hard to give the exact parametrization from his drawing alone, but it could be something like $r(t) = \arctan(t)$ for $t\geq 0$ in polar coordinates, or $r(t) = f(t)$ for any increasing $f$ that has a horizontal asymptote.
