Prove that $A$ is an open set and $B$ is a closed set. Suppose that $E \subseteq \mathbb R^m$. Let $$A=\{x \in \mathbb R^m: \rho (x, E) &lt; r\}, B=\{x \in \mathbb R^m: \rho (x, E) \le r\}.$$

Prove that $A$ is an open set and $B$ is a closed set.

Thanks ahead:)
The arbitrary union of open sets is open.  We certainly know that an open ball $B_r(x)$ (of radius $r$ centred at $x$) is an open set.  Behold:

$$A=\bigcup_{x\in E} B_r(x)$$

$B^c=\{x : \rho(x,E) &gt; r \}$. So if $x\in B^c$, let $d=\rho(x,E)$ then $d&gt;r$ so pick $\varepsilon &gt;0$ such that $d -\varepsilon &gt; r$ then by reverse triangle inequality $B_{\varepsilon} (x) \subset B^c$ thus the set is closed (it's complement is open). To see the last claim: Choose $x' \in \partial B_{\varepsilon}(x) $ then by the reverse triangle inequality we have $\rho(x',E) \ge \rho(x,E) -\rho(x,x')=d-\varepsilon &gt; r$ (which proves the claim)
Gvien $B_E(p,r)$ (with $r &gt; 0$ y $p \in E$) y $q \in B_E(p,r)$, we choose $r′ =r − \rho(p,q)$, thus we have that $B_E(q,r′) \subseteq B_E(p,r)$, which is what you wanted to proof.