How do I show that the set of all points that are less than $\varepsilon$ away from a set is open? If $A \subset \mathbb R$, we have the distance between a point in $\mathbb R$ and $A$ as
$$d(x,A)=\inf\{|x-a| \mid a \in A\}.$$
For $\varepsilon>0$, if we define $A(\varepsilon) = \{x \in \mathbb R \mid d(x,A) < \varepsilon \}$, how do we show this set is open?

I know that $A \subset A(\varepsilon)$ since for any point in $a \in A$ we will have $d(a, A)=0 < \varepsilon$ for any $\varepsilon >0$.
I can see that $A(\varepsilon)$ is sort of like a neighborhood of the set $A$ but I am having trouble formalizing this.
 A: Well, I'd start by taking an arbitrary $x\in A(\varepsilon).$ Since $d(x,A)<\varepsilon,$ then there is some $a\in A$ such that $|x-a|<\varepsilon.$ (Can you see why?) Thus, for any $x\in A(\varepsilon),$ we have that $$x\in\bigcup_{a\in A}(a-\varepsilon,a+\varepsilon).\tag{$\heartsuit$}$$ On the other hand, given an arbitrary $x$ as in $(\heartsuit),$ there is some $a\in A$ such that $|x-a|<\varepsilon,$ so $d(x,A)<\varepsilon.$ (Do you see why?) Thus, $x\in A(\varepsilon).$
By double inclusion, $$A(\varepsilon)=\bigcup_{a\in A}(a-\varepsilon,a+\varepsilon),$$ so as a union of open intervals, $A(\varepsilon)$ is open. (Can you justify this?)
A: If you know that a function is continous if and only if preimages of open sets are open, you can just prove that $d(x,A)$ is continous, and then observe that if $f(x) = d(x,A)$,
$$
A(\epsilon) = f^{-1}(-\infty, \epsilon)
$$
which is in fact the preimage via a continous function of the open set $(-\infty, \epsilon)$.
A: A set S in metric space is open if for any $x \in S$, there is $\delta>0$(this $\delta$ depends of $x$) such that $B_{\delta}(x) \subset S$.
Take $x \in A(\epsilon)$. In this case we choose $\delta = \epsilon - d(x,A)$.
Take $y \in B_{\delta}(x)$. Then we have $d(y,A) \leq d(y,x) + d(x,A)< \epsilon - d(x,A) + d(x,A)$.
Then $A(\epsilon)$ is open.
A: Geometrically one can guess that for any $b\in A(\varepsilon)$, the ball of radius $\frac{\varepsilon -d(b,A)}{2}$ and centered at $b$ will lie inside $A(\varepsilon)$. Of course you need to prove it mathematically.
