If $(X, d)$ is a metric space and $a \in X$, prove $f : (X, d) \to \mathbb{R}$ defined by $f(x) = d(x, a)$ is continuous 
If $(X, d)$ is a metric space and $a \in X$, prove $f : (X, d) \to \mathbb{R}$ defined by $f(x) = d(x, a)$ is continuous

My Attempt at a  Proof
Recall that a function $f : (X, d_x) \to (Y, d_y)$ is continuous if for each $x \in X$ and $\epsilon > 0$, there exists a $\delta > 0$ such that $$d_X(x, y) < \delta \implies d_Y(f(x), f(y)) < \epsilon$$
So let $\epsilon > 0$ be given and pick $x, y \in X$. 
Suppose that $d_Y((f(x), f(y)) < \epsilon$, then we have $d_Y\left(d_X(x, a), d_X(y, a)\right) < \epsilon \implies |d_X(x, a) - d_X(y, a)| < \epsilon \implies |d_X(x, y) - 2d_X(a, y)| < \epsilon$ (by the triangle inequality) 

But that was as far as I got, I need to algebraically manipulate $|d_X(x, y) - 2d_X(a, y)| < \epsilon$ into the form $|d_X(x, y)| = d_X(x, y) < \delta$ which would allow me to find a $\delta > 0$ that works for the given $\epsilon$, but I'm not sure how to go about doing that.
 A: What you are looking for is the reverse triangle inequality
$$|d(x,a)-d(y,a)| \le d(x,y), $$
which is a direct consequence of the triangle inequality
$$d(x,y)\le d(x,z) + d(y,z) .$$
A: The range is the line. Write $|a-b|$ instead of $d_Y(a,b)$.
You want to prove that $d_X(x,y) < \delta$ implies $|f(x) - f(y)| < \epsilon$, yet your argument begins with "suppose that $|f(x) - f(y)| < \epsilon$". There is no proof method where you are allowed to start by assuming what you need to prove.
The triangle inequality gives you $d_X(x,a) \le d_X(y,a) + d_X(x,y)$ so that $f(x) - f(y) \le d(x,y)$.  Exchange the roles of $x$ and $y$ and use the symmetry of the metric to get $f(y) - f(x) \le d_X(y,x) = d_X(x,y)$ too. Combined these give you $$|f(x) - f(y)| \le d_X(x,y).$$ Thus given $\epsilon > 0$ you can take $\delta =  \epsilon$.
A: The triangle inequality tell us that
$$d(x,a) - d(y,a) \leq d(x,y)$$
and
$$d(y,a) - d(x,a) \leq d(y,x) = d(x,y).$$
Thus
$$\vert d(x,a) - d(y,a) \vert \leq d(y,x).$$
A: From triangle inequality $d(x, a) \leq d(x, y) + d(y, a)$ so (after a bit of algebra and symmetry) $|d(x, a) - d(y, a)| \leq d(x, y).$ QED
