How do we prove $|\cos x-\cos y|\le|x-y|$ for all $x,y\in\mathbb{R}$?
Hint You're on the right track. If you instead write the derivative relationship in terms of integrals, you get $$|\cos x - \cos y| = \left\vert\int_x^y \sin x \,dx \right\vert \leq \cdots .$$
$$\cdots \leq \left\vert\int_x^y |\sin x| \,dx\right\vert .$$
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$).
hint
$$|\cos (x)-\cos (y)|=$$ $$2|\sin (\frac {x+y}{2})\sin (\frac {x-y}{2})|$$
and $$|\sin (a)|\le |a|$$