# The distance function is continuous.

Let $S\subset\Bbb R$ not empty, define $f:\Bbb R\rightarrow\Bbb R$ such that $f(x)= \inf\{|x-s| ;s\in S\}$

then, prove that $|f(x)-f(y)|\le|x-y|$ for any $x,y \in \Bbb R$

-
Have you tried the case where $S$ consists of a single point? –  JSchlather Sep 8 '12 at 1:41
$|x - s| \le |x - y| + |y - s|$ for every $s \in S$. Hence $f(x) \le |x - y| + f(y)$.
Similarly $f(y) \le |x - y| + f(x)$.
Hence $|f(x) - f(y)| \le |x - y|$.