Let $A$ be a non-empty set in a metric space $(X,d)$. Define $f: X \to \mathbb{R}$ by $f(x) = \inf \{d(a,x) : a \in A \}$. Prove that $f$ is continuous.
If $f$ is continuous, then $\forall \epsilon > 0 \ \exists \delta > 0$ such that $$d(x,y) < \delta \implies \left| \inf \{d(a,x) : a \in A \} - \inf \{d(a,y) : a \in A \} \right| < \epsilon.$$
I'm not sure where to go from here.
We will use epsilon of the room technique. Fix $x,y\in X$. Let $\varepsilon>0$ be given. Then there is $a\in A$ such that \begin{equation} d\left(a,x\right) \le f\left(x\right)+\frac{\varepsilon}{2}.\tag{1} \end{equation} So \begin{align*} f\left(y\right)-f\left(x\right) & \le f\left(y\right)+\frac{\varepsilon}{2}-d\left(a,x\right)\\ & \le d\left(a,y\right)-d\left(a,x\right)+\frac{\varepsilon}{2}. \end{align*} The first inequality comes from (1) and the second inequality comes from the definition of $f$.
Since $$ \left|d\left(a,x\right)-d\left(a,y\right)\right|\le d\left(x,y\right), $$ we see that $$ f\left(y\right)-f\left(x\right)\le d\left(x,y\right)+\frac{\varepsilon}{2}. $$ By similar principle, we have $$ \left|f\left(y\right)-f\left(x\right)\right|\le d\left(x,y\right)+\frac{\varepsilon}{2}. $$ Since $\varepsilon>0$ was arbitrary, we obtain the conclusion.