When the set of $r$-far interior points from a set is open Let $E$ be a subset of a metric space $X$ and for $r > 0$ let
$$ E_r = \lbrace x \in E : d(x,E^c) > r \rbrace .$$
Is the set $E_r$ always open? Equivalently, is the function
$ x \mapsto d(x,E^c)$ continuous?
 A: for given any non-empty set $A$... $x \mapsto d(x,A)$ is always continuous.
in your question if we consider $f : X \to \mathbb{R}$, $f(x)= d(x,E^c)$..then $E_r = f^{-1}((r, \infty))$ which is open since $f$ is continuous.
A: Yes, if $x \in E_r$ then $B_\epsilon(x) \subseteq E_r$ where $\epsilon=\frac{1}{2}(d(x,E^c)-r)$.
A: Claim: Let $A$ be any non-empty set in the metric space $(X,d)$, then $x \mapsto d(x,A)$ is continuous.
Proof: Let $x,y \in X$, $a \in A$.  Then $d(x,a) \le d(x,y) + d(y,a)$, so that $$d(x,A) \le d(x,a) \le d(x,y) - d(y,a),$$
which we can rewrite as $$d(x,A) - d(y,a) \le d(x,y).$$
Since this holds for every $a \in A$ we can conclude that $$d(x,A) - d(y,A) \le d(x,y).$$
Finally, interchange the roles of $x$ and $y$ to get $$|d(x,A) - d(y,A)| \le d(x,y),$$ which by definition shows the continuity of $d(\cdot,A)$. $\blacksquare$

Claim 2: $E_r$ is open.
Proof: We know that $E_r = E \cap d^{-1}((r,\infty), A)$, expanding this we get: $$E_r  = \Big(\text{Int}(E) \cup (E \cap \partial E)\Big) \cap d^{-1}((r,\infty), A) \\ = \Big(\text{Int}(E) \cap d^{-1}((r,\infty), A)\Big) \cup \Big((E \cap \partial E) \cap d^{-1}((r,\infty)\Big) \\ \subset \Big(\text{Int}(E) \cap d^{-1}((r,\infty), A)\Big) \cup \Big(\partial E \cap d^{-1}((r,\infty)\Big) \\ = \Big(\text{Int}(E) \cap d^{-1}((r,\infty), A)\Big),$$
which is open being the intersection of open sets. $\blacksquare$

Notice that in the last line we used that $d(\cdot,A)$ is continuous twice! Indeed we used that the preimage of an open set is open, and that if $x \in \partial E$ then $d(x,A) = 0.$ This follows from the fact that if $\{x_n\} \subset E^c$ is such that $d(x_n,x) \to 0$, we have that $$0 = d(x_n,A) \to d(x,A),$$
forcing this last quantity to be $0$.
