[proofplan]
Both directions are proved by contradiction, exploiting the interplay between convergent sequences (which characterize [closed sets](/page/Closed%20Set)) and open balls (which characterize [open sets](/page/Open%20Set)). If $A$ is closed and $x \in X \setminus A$, failure of openness at $x$ would produce a sequence in $A$ converging to $x$, contradicting closedness. Conversely, if $X \setminus A$ is open and a sequence in $A$ converges to $x \notin A$, the open ball around $x$ in $X \setminus A$ would contain a term of the sequence, contradicting membership in $A$.
[/proofplan]
[step:Show that closedness of $A$ implies $X \setminus A$ is open]
Let $x \in X \setminus A$. Suppose for contradiction that for every $n \in \mathbb{N}$, there exists $x_n \in A$ with $d(x_n, x) < 1/n$. Then $(x_n)$ is a [sequence](/page/Sequence) in $A$ with $x_n \to x$. Since $A$ is [closed](/page/Closed%20Set), $x \in A$, contradicting $x \in X \setminus A$. Therefore there exists $n_0 \in \mathbb{N}$ with $B(x, 1/n_0) \cap A = \varnothing$, i.e., $B(x, 1/n_0) \subseteq X \setminus A$. Since $x \in X \setminus A$ was arbitrary, $X \setminus A$ is [open](/page/Open%20Set).
[guided]
We want to show that every point $x \in X \setminus A$ has an open ball contained in $X \setminus A$, which is the definition of $X \setminus A$ being open. We proceed by contradiction.
Suppose this fails for some $x \in X \setminus A$: for every $r > 0$, the ball $B(x, r)$ intersects $A$. Taking $r = 1/n$ for $n = 1, 2, 3, \ldots$, we choose $x_n \in A \cap B(x, 1/n)$. This produces a sequence $(x_n)$ with $x_n \in A$ and $d(x_n, x) < 1/n$, so $x_n \to x$.
Now we invoke the hypothesis: $A$ is closed, meaning it contains all limits of convergent sequences from $A$. Since $(x_n) \subseteq A$ and $x_n \to x$, closedness forces $x \in A$. But $x$ was chosen from $X \setminus A$, so $x \notin A$ --- a contradiction.
The contradiction shows that the assumption was wrong: there must exist some $n_0 \in \mathbb{N}$ with $B(x, 1/n_0) \cap A = \varnothing$, i.e., $B(x, 1/n_0) \subseteq X \setminus A$. Setting $r = 1/n_0$ gives the desired open ball.
Since $x \in X \setminus A$ was arbitrary, every point of $X \setminus A$ is an interior point, and $X \setminus A$ is open.
[/guided]
[/step]
[step:Show that openness of $X \setminus A$ implies $A$ is closed]
Let $(x_n)_{n=1}^\infty$ be a [sequence](/page/Sequence) in $A$ with $x_n \to x$ in $(X,d)$. Suppose for contradiction that $x \notin A$, i.e., $x \in X \setminus A$. Since $X \setminus A$ is [open](/page/Open%20Set), there exists $r > 0$ with $B(x, r) \subseteq X \setminus A$. Since $x_n \to x$, there exists $N \in \mathbb{N}$ with $d(x_n, x) < r$ for all $n \geq N$. In particular, $x_N \in B(x, r) \subseteq X \setminus A$, contradicting $x_N \in A$. Therefore $x \in A$, so $A$ is [closed](/page/Closed%20Set).
[guided]
We want to show $A$ is closed, which means: if $(x_n)$ is a sequence in $A$ with $x_n \to x$ in $(X, d)$, then the limit $x$ belongs to $A$. We prove this by contradiction.
Suppose $(x_n) \subseteq A$ with $x_n \to x$, and assume for contradiction that $x \notin A$. Then $x \in X \setminus A$, and since $X \setminus A$ is open by hypothesis, there exists $r > 0$ with $B(x, r) \subseteq X \setminus A$.
Since $x_n \to x$, the sequence eventually enters every ball around $x$. In particular, there exists $N \in \mathbb{N}$ with $d(x_N, x) < r$, so $x_N \in B(x, r)$.
But $B(x, r) \subseteq X \setminus A$, so $x_N \in X \setminus A$. This contradicts $x_N \in A$ (since every term of the sequence lies in $A$).
The contradiction forces $x \in A$. Since the convergent sequence $(x_n)$ was arbitrary, every convergent sequence in $A$ has its limit in $A$, and $A$ is closed.
[/guided]
[/step]