A closed ball in a metric space is a closed set 
Prove that a closed ball in a metric space is a closed set

My attempt: Suppose $D(x_0, r)$ is a closed ball. We show that $X \setminus D $ is open. In other words, we need to find an open ball contained in $X \setminus D$. 
Pick $$t \in X-D \implies d(t,x_0) > r \implies d(t,x_0) - r > 0 $$ Let $B(y, r_1)$ be an open ball, and pick $z \in B(y,r_1)$. Then, we must have $d(y,z) < r_1 $. We need to choose $r_1$ so that $d(z,x_0) > r$. Notice by the triangle inequality
$$ d(x_0,t) \leq d(x_0,z) + d(z,t) \implies d(z,x_0) \geq d(x_0,t) - d(z,t) > d(x_0,t) - r_1.$$
Notice, if we pick $r_1 = d(t,x_0)-r$ then we are done.
Is this correct?

No I do not think this is correct. The idea seems correct, but the execution was poor. You should specify that $y\in X\backslash D$. I am also not sure how you justify your last inequality.  If $t$ is arbitrary in $X\backslash D$ we cannot conclude $d(z,t)<r_1$ and $-d(z,t)>-r_1.$ 
Here is how I would solve the problem:
Let $X$ be a metric space, $p\in X$, $r>0$. 
Let $A=\{q\in X :d(p,q)\leq r\}$.  Let $\{q_k\}\in A$ with $d(q_k,q)\rightarrow 0$. 
We want to show $q\in A$. 
By the triangle inequality we have  $$d(q,q_k)+d(q_k,p)\ge d(q,p)$$. $\Rightarrow$ $$d(q,q_k)+r\ge d(q,p)$$ (Since $\{q_k\}\subseteq A)$
Now take the limit as $k\rightarrow \infty$ of both sides and we have $$0+r\ge d(p,q)$$
$$\Rightarrow q\in A$$ $\Rightarrow A$ is closed $$QED$$
