TITLE: Show that in a discrete metric space, every subset is both open and closed.
QUESTION [35 upvotes]: I need to prove that in a discrete metric space, every subset is both open and closed. Now, I find it difficult to imagine what this space looks like. I think it 
consists of all sequences containing ones and zeros. 
Now in order to prove that every subset is open, my books says that for 
$A \subset X $,
$A$ is open if $\,\forall x \in A,\,\exists\, \epsilon > 0$ such that $B_\epsilon(x) \subset A$.
I was thinking that since $A$ will also contain only zeros and ones, it must be open. Could someone help me ironing out the details?

REPLY [3 votes]: Let $(X,d)$ be a metric space. Suppose $A \subset X$. Let $ x\in A$ be arbitrary. Setting $r = \frac{1}{2}$ then if $a \in B(x,r)$ we have $d(a,x) < \frac{1}{2}$ which implies that $a=x$ and so a is in A. (1)
To show that A is closed. It suffices to note that the complement of A is a subset of X and by (1), it is open hence A must be closed.