Let $x, y \in \mathbb{R}$ be arbitrary, and without loss of generality, assume $y < x$.
The function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(t) = \cos(t)$ is continuous and differentiable in $\mathbb{R}$, so it is obviously continuous in $[y, x]$ and differentiable in $(y, x)$.
By the Mean Value Theorem, there exists a point $c \in (y, x)$ such that
$$f^{\prime}(c) = -\sin(c) = \dfrac{\cos(x)-\cos(y)}{x-y}\text{.}$$
However, recalling that $|-\sin(w)| = |\sin(w)| \leq 1$ for all $w \in \mathbb{R}$, it follows that
$$\left|\dfrac{\cos(x)-\cos(y)}{x-y}\right| \leq 1$$
hence
$$|\cos(x)-\cos(y)| \leq |x-y|$$
and the claim follows since $x$ and $y$ were arbitrarily chosen.
If $y > x$, then a nearly-identical argument to the above leads to the same conclusion.
If $y = x$, equality holds (since $|\cos(x)-\cos(y)| = |x-y| = 0$).