Subsets of $(X,d)$ where $d$ is the discrete metric are both closed and open I have an exercise in my notebook, which i'm not sure if i'm doing it right.
Exercise: Show that if $X$ is equipped with the discrete metric $d$ then every subset of $X$ is both open and closed.
Definition of discrete metric:
$d(x,x)=0$ and $d(x,y)=1$ if $x\neq y$
My approach:
Take an arbitrary set $A\subset X$.
Take a closed ball $\overline{B}(x,\epsilon)=\{y\in X: d(x,y)\leq \epsilon\}\subset A$ such that $\epsilon=1$.
Now, take points all points $x'\in \overline{B}$ such that $d(x,\epsilon)=0$. These points $\{x'\}$ are then open sets by themselves since $\forall x\in\{x'\} \exists \epsilon=1/2$  such that $B(x,\epsilon)\subset \{x'\}$.
Therefore $B(x,\epsilon)\subset\{x'\}\subset \overline{B}(x,\epsilon)$. Hence by definition $\overline{B}(x,\epsilon)$ is open.
Since $A=\cup_{i=1}^n \overline{B}(x,\epsilon)$, it follows that $A$ is a union of both closed and open balls. Hence it's both closed and open.
Would this be correct?
 A: 
Take an arbitrary set $A\subset X$.
Take a closed ball $\overline{B}(x,\epsilon)=\{y\in X: d(x,y)\leq \epsilon\}\subset A$ such that $\epsilon=1$.

You just start using $x$ here without any definition. From the remainder of your post, it is clear that $x$ is an arbitrary element of $A$. But you need to introduce it before you start using it. "Let $x \in A$."
If you are going to talk about $\overline{B}(x,1)$, talk about $\overline{B}(x,1)$. Don't try to disguise it by calling $1$ "$\epsilon$" instead. It leads you into trouble later.
But a bigger problem, as has already been mentioned, is that there is no guarantee that $\overline{B}(x,1) \subset A$, for two reasons. First, $A$ is arbitrary. You have no guarantee that $x$ will have any neighborhood in $A$, much less a closed one. That $A$ is open is what you are trying to prove. You cannot assume properties of open sets until you do. Second, even if $A$ were known to be open, in general you cannot guarantee that that a ball of a particular size must fit in $A$. You cannot assume that $\epsilon = 1$ will work.
And for this particular metric, $\overline B(x,1) = X$, so $\overline B(x,1) \subset A$ would only be true when $A = X$.

Now, take points all points $x'\in \overline{B}$ such that $d(x,\epsilon)=0$.

Presumably you meant "Now, take all points $x'\in \overline{B}$ such that $d(x,x')=0$." But $d(x,x')=0$ means $x' = x$, so it is ridiculous to keep pretending you are talking about more than one point.

These points $\{x'\}$ are then open sets by themselves since $\forall x\in\{x'\} \exists \epsilon=1/2$  such that $B(x,\epsilon)\subset \{x'\}$.

Here you commit a cardinal sin of mathematics: $x$ already has a specific meaning at this point. And it is a meaning that you continue to use later. But suddenly in this sentence, $x$ takes on a different meaning. You also commit the same sin for $\epsilon$, which previously had value $\epsilon = 1$, but now you have $\epsilon = \frac 12$. If you were done with the previous meaning of $\epsilon$, this would be alright. But you aren't done with it. You use that previous meaning in the very next sentence.

Therefore $B(x,\epsilon)\subset\{x'\}\subset \overline{B}(x,\epsilon)$. Hence by definition $\overline{B}(x,\epsilon)$ is open.

And here your sins come to haunt you. When you picked $x' \in\overline{B}(x,\epsilon)$, $x$ was an arbitrary point in $A$, and $\epsilon = 1$. Where you came up with $B(x,\epsilon) \subset \{x'\}$, $x$ was point in $\{x'\}$ (i.e., $x = x'$), and $\epsilon = \frac 12$. The two sides of this chain of subsets are different sets. They only look the same (other than the closure) because you abused the notation. It's a different $x$ and a different $\epsilon$.
But also, this sequence of subsets does not show that $\overline{B}(x,\epsilon)$ is open. It is always true (for any metric, single $x\in X$, single $\epsilon > 0$) that $B(x,\epsilon) \subset \overline{B}(x,\epsilon)$, but generally $\overline{B}(x,\epsilon)$ is not open.

Since $A=\cup_{i=1}^n \overline{B}(x,\epsilon)$, it follows that $A$ is a union of both closed and open balls. Hence it's both closed and open.

What? Where did this come from? First, what is $n$? Second, you just have one set in the union. There is no dependence on the index $i$. Third, why should $A$ be equal to this union? Fourth, why is this a finite union? There is no guarantee $A$ is finite. There is no reason to believe it is even countable. And if the union isn't finite, it doesn't prove $A$ is closed, as only a finite union of closed sets need be closed.
