# Set that contains all its accumulation points is closed

I am taking a course in complex analysis and have an exam next week. I am trying to solve some past exam questions. One question asks to prove that a set that contains all its accumulation points is closed. I know from studying topology course that this is true because this is kind of the definition of a closed set but I am not sure how to prove this in the context of complex analysis. All that we have learnt about closed and open sets is that a set of the sort $|z-1|<1$ is open while the set $|z-1|\leq1$ is closed. How to prove that set that contains all its accumulation points is closed in the context of complex analysis.

Let $S$ be the given set. Suppose $S$ is not closed. Then $S^c$ is not open. Hence there exists $z \in S^c$ such that $B(z,\dfrac{1}{n}) \cap S \ne \phi$. Let $z_n \in \left(B(z,\dfrac{1}{n}) \right) \cap S$. Then $z_n \to z$ and $z_n \in S$. By the assumption, $z$ must be in $S$. But this cannot happen since $z$ was chosen from $S^c$. This is a contradiction. Hence $S$ is closed.
You can show that the complement of such a set $S$ is open. Suppose the complement $U$of $S$ is not open, there exists $u\in U$ such that for every integer $n>0, \{|z-u|<1/n\}\cap S$ is not empty. Let $u_n$ in $\{|z-u|<1/n\}\cap S$, $lim_nu_n=u$ and $u$ not in $S$ contradiction.