I want to prove that given a metric space $(M,d)$ and $F \subset M$, then the function $f_F: M \to \Bbb R$ given by $f_F(x) = d(x,F) = \inf\{d(x,y) \ : \ y \in M\}$ is continuous.
Take $x \in M$. If $x \in F$ it is obvious. I am convinced that it is continuous, since if you take a sequence $(x_n)_{n \in \Bbb N}$ which converges to $x \in M$, then the distances from the $x_n$ to $F$ go close to the distance from $x$ to $F$, since the $x_n$ go close to $x$.
But I'm having much trouble writing it. My teacher said to "just forget about the $\inf$ and work with sequences", but that doesn't help me at all.
Given $\epsilon > 0$ and a sequence $(x_n)_{x \in \Bbb N}$ such that $x_n \to x$, I must prove that $f_F(x_n) \to f_F(x)$, that is, find $n_\epsilon \in \Bbb N$ such that: $$n > n_\epsilon \implies |d(x_n,F) - d(x,F)| < \epsilon $$
Surely if $y \in F$, we have $d(x,y) \geq d(x,F)$. Other than this, I don't know how to deal with these infs, and this absolute value. I suppose I'll have to use the triangle inequality. Can someone help me do it?