[proofplan]
We prove both implications directly from the definitions. If $A$ is closed, then $X \setminus A$ is open, so a point outside $A$ has an open neighbourhood disjoint from $A$ and therefore cannot be a [limit point](/page/Limit%20Point) of $A$. Conversely, if every limit point of $A$ belongs to $A$, then each point outside $A$ is not a limit point, which gives an open neighbourhood meeting $A$ only possibly at that point; since the point is outside $A$, this neighbourhood is disjoint from $A$. Thus $X \setminus A$ is open, so $A$ is closed.
[/proofplan]
[step:Show that closedness forces every limit point to lie in $A$]
Assume that $A$ is closed in $X$. By definition of closedness, $X \setminus A \in \tau$.
Let $x \in A'$. Suppose, for contradiction, that $x \notin A$. Then $x \in X \setminus A$, and since $X \setminus A$ is open, the set
\begin{align*}
U := X \setminus A
\end{align*}
is an open neighbourhood of $x$. But
\begin{align*}
U \cap (A \setminus \{x\}) = (X \setminus A) \cap (A \setminus \{x\}) = \varnothing,
\end{align*}
contradicting the defining property of $x \in A'$. Hence $x \in A$. Since $x \in A'$ was arbitrary, $A' \subset A$.
[guided]
Assume that $A$ is closed in $X$. The definition of closedness in a [topological space](/page/Topological%20Space) says exactly that the complement $X \setminus A$ is open, so
\begin{align*}
X \setminus A \in \tau.
\end{align*}
We want to prove $A' \subset A$, so let $x \in A'$ be arbitrary. The goal is to show $x \in A$. Suppose instead that $x \notin A$. Then $x$ lies in the complement $X \setminus A$. Since this complement is open, it is an open neighbourhood of $x$.
Now compare this neighbourhood with the definition of a limit point. Because $x \in A'$, every open neighbourhood of $x$ must meet $A \setminus \{x\}$. Taking the particular open neighbourhood
\begin{align*}
U := X \setminus A,
\end{align*}
we compute
\begin{align*}
U \cap (A \setminus \{x\}) = (X \setminus A) \cap (A \setminus \{x\}) = \varnothing.
\end{align*}
This contradicts the condition that $x \in A'$. Therefore the assumption $x \notin A$ is impossible, and hence $x \in A$. Since the argument applies to every $x \in A'$, we conclude that
\begin{align*}
A' \subset A.
\end{align*}
[/guided]
[/step]
[step:Show that containing all limit points forces closedness]
Assume that $A' \subset A$. We prove that $X \setminus A$ is open.
Let $x \in X \setminus A$. Since $x \notin A$ and $A' \subset A$, we have $x \notin A'$. By the definition of $A'$, there exists an [open set](/page/Open%20Set) $U_x \in \tau$ such that $x \in U_x$ and
\begin{align*}
U_x \cap (A \setminus \{x\}) = \varnothing.
\end{align*}
Because $x \notin A$, we have $A \setminus \{x\} = A$, so
\begin{align*}
U_x \cap A = \varnothing.
\end{align*}
Thus $U_x \subset X \setminus A$.
We have shown that for every $x \in X \setminus A$, there exists $U_x \in \tau$ with
\begin{align*}
x \in U_x \subset X \setminus A.
\end{align*}
Therefore $X \setminus A$ is open. Hence $A$ is closed in $X$.
[/step]
[step:Combine the two implications]
The first step proves that if $A$ is closed in $X$, then $A' \subset A$. The second step proves that if $A' \subset A$, then $A$ is closed in $X$. Therefore $A$ is closed in $X$ if and only if
\begin{align*}
A' \subset A.
\end{align*}
This proves the theorem.
[/step]