Let $X = \mathbb{R} \cup \{-\infty, +\infty \}$. Consider $d = \big | \frac{x|x|}{1 + x^2} - \frac{y |y|}{1 + y^2} \big |$ and
$d(-\infty, +\infty) = 2$ and
$d(x, +\infty) = \lim_{y \to +\infty} d(x, y)$. Similarly, for $d(-\infty, x)$.
I want to show the metric space $(X, d)$ is complete and compact.
To show completeness, every Cauchy sequence must have a limit in $X$.
Intuitively, it is obvious that every sequence has a limit which is either a real number or $\pm \infty$.
Perhaps it is easier to show compactness first and use the result compactness $\implies $ completeness.
Note that $f(x) = \frac{x|x|}{1+x^2}$ is a bijection from $\mathbb{R}$ to $(-1, 1)$. Defining $f(-\infty)=-1$ and $f(\infty)=1$ we get a bijection from $\overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty, \infty\}$ to $[-1, 1]$.
You're using $f$ to induce a metric $d$ on $\overline{\mathbb{R}}$. From the equation $d(x, y)=|f(x)-f(y)|$, we have that $(\overline{\mathbb{R}}, d)$ is isometric to $[-1, 1]$ with the metric induced from $\mathbb{R}$.
Therefore, $(\overline{\mathbb{R}}, d)$ has all the properties that $[-1, 1]$ has as a metric space. In particular, it is compact and complete.