Show that $D(A,\varepsilon)$ is open 
Let $A \subseteq \mathbb{R}^n$ and $x \in \mathbb{R}^n$. We define
  $d(x,A)$= $\inf$ {$d(x,y): y \in A$} and for each $\varepsilon > 0$,
  let $D(A, \varepsilon)$ = {$x: d(x,A) < \varepsilon$}
  
  
*
  
*Show that $D(A,\varepsilon)$ is open.
  
*Let $A\subseteq \mathbb{R}^n$ and $N_\varepsilon$= {$x \in \mathbb{R}^n : d(x,A) \leq \varepsilon$}, where $\varepsilon > 0$.
  Show that $N_\varepsilon$ is closed and that $A$ is closed if, and only
  if, 
  $A=\cap${$N_\varepsilon: \varepsilon >0$}
  

My attempt: To show the first one, let $x \in D(A, \varepsilon)$. I've tried to prove that exists an $r>0$ such that $B_r(x) \subseteq D(A, \varepsilon)$. Let $z \in B_r(x)$, so $d(z,x) < r$. But I wasn't successful going this way, since I couldn't find any inequallity envolving what I need. 
Any hint or solutions would all be appreciated! :)
Edit: I've found this post How do I show that the set of all points that are less than $\varepsilon$ away from a set is open? that proves the first one. But how do we have that $d(z,A) \leq d(z,x) + d(x,A)< \epsilon - d(x,A) + d(x,A)$?
 A: A way to solve the questions is the following: show that the map $x\mapsto d(x,A)$ is Lipschitz. To this aim, note that for all $x,x'\in\mathbb R^n$ and all $a\in A$, 
$$
d(x,a)\leqslant d(x,x')+d(x',a)
$$
hence taking the infimum over $a\in A$ gives $d(x,A)\leqslant d(x,x')+d(x',A)$ or in other words, $d(x,A)-d(x',A)\leqslant d(x,x')$. Then switch the roles of $x$ and $x'$ to get the wanted inequality. 
A: Your approach sounds like a good one. If $x \in D(A,\epsilon)$, then we know
$$\inf\{d(x,y) ~:~y \in A\} <\epsilon.$$
In particular, there exists $y \in A$ such that $d(x,y)<\epsilon$. Now we want to show there exists $r$ such that if $d(x,z)<r$, then $d(x,y)<\epsilon$ (since this will imply that $d(z,A)=\inf\{d(z,y') ~:~ y' \in A\}<\epsilon$). 
The triangle inequality will be useful here: $d(z,y) \leq d(z,x) + d(x,y)$. However, as you probably saw, the only thing we can bound this by right now is $\epsilon+r$ which is too big.
To get around this, it's helpful to quantify how much smaller $d(x,y)$ is than $\epsilon$. We can set $\delta:=\epsilon-d(x,y) >0$, and then we know $d(x,y) \leq \epsilon-\delta$. Now we can use the triangle inequality to say $d(z,y) \leq d(z,x)+d(x,y) \leq \epsilon-\delta+r$. I'll leave it to you to pick $r$ that guarantees this is $<\epsilon$. (Note the strict inequality here! Picking $r=\delta$ is not quite enough.)
A: For Q.1:
Actually, it is true for a general metric space $(X,d)$. Let $A\subseteq X$.
Firstly, observe that if $A=\emptyset$, then $d(x,A)=\infty$ for
any $x\in X$ (because by convention, the infimum of empty set is
$\infty$). In this case $D(A,\varepsilon)=\emptyset$, which is obviously
open.
Suppose that $A$ is non-empty. Let $\varepsilon>0$ be given. If
$D(A,\varepsilon)=\emptyset$, we are done. Suppose that $D(A,\varepsilon)\neq\emptyset$.
Let $x_{0}\in D(A,\varepsilon)$ be arbitrary. Denote $l=d(x_{0},A)<\varepsilon$.
Let $\delta=\frac{1}{2}(\varepsilon-l)>0$. We assert that $B(x_{0},\delta)\subseteq D(A,\varepsilon)$
and it will follow that $D(A,\varepsilon)$ is open.
Note that $l+\delta$ is not a lower bound of the set $\{d(x_{0},y)\mid y\in A\}$,
so there exists $y\in A$ such that $d(x_{0},y)<l+\delta$. Let $x\in B(x_{0},\delta)$
be arbitrary. Observe that 
\begin{eqnarray*}
d(x,A) & \leq & d(x,y)\\
 & \leq & d(x,x_{0})+d(x_{0},y)\\
 & < & \delta+l+\delta\\
 & = & \varepsilon.
\end{eqnarray*}
Therefore $x\in D(A,\varepsilon)$ and hence $B(x_{0},\delta)\subseteq D(A,\varepsilon)$.
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
For Q.2:
Claim: $N_{\varepsilon}$ is closed.
Let $\varepsilon>0$ be given. Observe that $N_{\varepsilon}^{c}=\{x\in X\mid d(x,A)>\varepsilon\}$.
We go to show that $N_{\varepsilon}^{c}$ is open. If $A=\emptyset$,
then $N_{\varepsilon}^{c}=X$ which is open. Suppose that $A\neq\emptyset$.
Let $x_{0}\in N_{\varepsilon}^{c}$. Let $l=d(x_{0},A)>\varepsilon$.
Let $\delta=\frac{1}{2}(l-\varepsilon)>0$. We assert that $B(x_{0},\delta)\subseteq N_{\varepsilon}^{c}$.
Let $x\in B(x_{0},\delta)$. Let $y\in A$ be arbitrary, then
\begin{eqnarray*}
l & = & d(x_{0},A)\\
 & \leq & d(x_{0},y)\\
 & \leq & d(x_{0},x)+d(x,y)\\
 & < & \delta+d(x,y).
\end{eqnarray*}
That is, $d(x,y)>l-\delta$. Since $y\in A$ is arbitrary, it follows
that $d(x,A)=\inf_{y\in A}d(x,y)\geq l-\delta=\varepsilon+\delta>\varepsilon$.
This shows that $B(x_{0},\delta)\subseteq N_{\varepsilon}^{c}$.
////////////////////////////////////////////////
It seems that the proposition " $A$ is open iff $A=\cap\{N_{\varepsilon}\mid\varepsilon>0\}$ "
is problematic because $\cap\{N_{\varepsilon}\mid\varepsilon>0\}$
is always a closed subset of $X$. Should the proposition be " $A$
is closed iff $A=\cap\{N_{\varepsilon}\mid\varepsilon>0\}$ " ?
We go to prove that: " $A$ is closed iff $A=\cap\{N_{\varepsilon}\mid\varepsilon>0\}$ ".
The $\Leftarrow$ direction is trivial because arbitrary intersection
of closed sets is closed.
$\Rightarrow$: Suppose that $A$ is closed. Observe that for each
$\varepsilon>0$, $A\subseteq N_{\varepsilon}$, so $A\subseteq\cap\{N_{\varepsilon}\mid\varepsilon>0\}$.
It remains to prove that $\cap\{N_{\varepsilon}\mid\varepsilon>0\}\subseteq A$.
Let $x\in\cap\{N_{\varepsilon}\mid\varepsilon>0\}$. For each $n\in\mathbb{N}$,
$x\in N_{\frac{1}{n}}\Rightarrow$ $d(x,A)<\frac{2}{n}$. Therefore,
there exists $y_{n}\in A$ such that $d(x,y_{n})<\frac{2}{n}$ (because
$\frac{2}{n}$ is not a lower bound of the set $\{d(x,y)\mid y\in A\}$.
By the Axiom of Choice (or at least, invoking the Axiom of countable
choice), we obtain a sequence $(y_{n})$ in $A$ such that $d(x,y_{n})<\frac{2}{n}$.
Clearly $y_{n}\rightarrow x$. Since $A$ is closed, we have $x\in A$. 
