Let the induced topology be $(X, \tau)$. Let $(x, y) \subset \Bbb R$. I'm required to prove that $f^{-1}((x, y))$ is open in $\tau$
$f^{-1}((x, y)) = \{p \in X : x < d(p, a) < y \}$
My thinking is to show this is a union of open balls. Don't know if this is allowed, but for each $p \in f^{-1}((x, y))$, find a $\delta > 0$ such that $B_\delta(p) \subseteq f^{-1}((x, y)) $
Am I going in the right direction with this? Not sure how to proceed regardless.
It might be easier to prove it directly as in:
$f(x) = d(x,a) \le f(y)+ d(x,y) = f(y) + d(x,y)$. Swapping the roles of $x,y$ we get $|f(x)-f(y)| \le d(x,y)$ from which continuity follows.
Since $f$ is continuous, $f^{-1} ((x,y))$ is open.