Lemma. Let $A\subseteq \Bbb R$ have no isolated points. Then there there are $A_1,A_2$ with
- $A_1\cap A_2=\emptyset$
- $A_1\cup A_2=A$
- $\overline{A_1}=\overline{A_2}=\overline A$
Proof.
Let $$\mathscr Z=\{\,(U,V)\mid U\cap V=\emptyset, U\cup V\subseteq A,\overline U=\overline V\,\}.$$
Then $\mathscr Z$ is partially ordered by inclusion, i.e., we say $(U,V)\preceq (U',V')$ if $U\subseteq U'$ and $V\subseteq V'$.
Let $\mathscr C\subseteq \mathscr Z$ be a totally ordered subset.
Let $\hat U=\bigcup_{(U,V)\in \mathscr C}U$ and $\hat V=\bigcup_{(U,V)\in \mathscr C}U$. If $x\in \hat U\cap \hat V$, then $x\in U$ and $x\in V'$ for soem $(U,V)(U',V')\in\mathscr C$. But either $U\subseteq U'$ or $V'\subseteq V$ so that $x\in U\cap V$ or $x\in U'\cap V'$ - but both are impossible. Hence $\hat U\cap \hat V=\emptyset$. Also clearly $\hat U\cup \hat V\subseteq A$. If an open set $O$ is disjoint from $\hat U$, then it is disjoint from $U$ for every $(U,V)\in\mathscr C$, hence also disjoint from $V$ for every $(U,V)\in\mathscr C$, i.e., disjoint from $\hat V$. Together with the symmetric conclusion, we find that $\overline{\hat U}=\overline{\hat V}$. In summary, $(\hat U,\hat V)\in \mathscr Z$.
By Zorn's lemma, we conclude that $\mathscr Z$ has a maximal element $(A_1,A_2)$.
Assume $a\in A\setminus(A_1\cup A_2)$. If $a\in \overline{A_1}$ then $(A_1\cup\{a\},A_2)$ contradicts maximality of $(A_1,A_2)$.
Hence there is an open neighbourhood $(a-r,a+r)$ of $a$ that is disjoint from the $\overline{A_i}$.
We construct a sequence of sets of pairwise disjoint open intervals, where each interval is in $(a-r,a+r)$ and centered around a point of $A$. We start with $S_0=\{(a-r,a+r)$.
Given $S_n$ and $(\xi-\rho,\xi+\rho)\in S_n$, we know that $\xi$ is not isolated, hence can pick a sequence $\xi_i\to \xi$ in $A$ where wlog the $\xi_i$ are distinct and in $(\xi-\rho,\xi+\rho)$, and by discreteness of this sequence can pick $\rho_i$ such that the $(\xi_i-\rho_i,\xi_i+\rho_i)$ are pairwise disjoint and are in $(\xi-\rho,\xi+\rho)$. We pick such a sequence for each $(\xi-\rho,\xi+\rho)\in S_n$ and let $S_{n+1}$ be the set of all these intervals.
By construction, the intervals in $S_{n+1}$ are pairwise disjoint. Now let $B_1$ be the set of interval midpoints of intervals in some $S_n$ with odd $n$, and similarly $B_2$ for even $n$. By construction, $B_1\subseteq \overline{B_2}$ and $B_2\subseteq\overline{B_1}$, so that $(A_1\cup B_1, A_2\cup B_2)$ contradicts the maximality of $(A_1,A_2)$.
We conclude that $A_1\cup A_2=A$ and then also $\overline A=\overline{A_1}=\overline{A_2}$. $\square$
Corollary. For every $n\ge1$, a set $A$ as in the lemma, there are sets $A_1,\ldots, A_n$ with
- $A_i\cap A_j)=\emptyset$ for $i\ne j$.
- $\bigcup_{i=1}^nA_i=A$
- $\overline{A_i}=\overline A$ for all $i$
Proof. Induction, where we use the lemma to split $A_n$ into two subsets. $\square$
Remark. Of course, the $A_i$ in the lemma as well as in the corollary are also without isolated points.
Proposition. For every finite topological space $X$, there exists a compact set $C\subset \Bbb R$ and a map $\mu\colon X\to\mathcal P(C)$ such that
- $\mu(x)\cap \mu(y)=\emptyset$ if $x\ne y$
- $\bigcup_{x\in A}\mu(x)$ is closed iff $A$ is closed
- $\mu(x)$ has no isolated points
Proof.
Induction on $|X|$, the case $|X|=0$ being trivial.
Let $A$ be a maximal closed subset $\ne X$, i.e. $A$ is closed and the only closed subset properly containing $A$ is $X$. By induction hypothesis, there exists a compact $C_A$ and a map $\mu_A\colon A\to \mathcal P(C_A)$ as in the proposition.
For each $x\in X\setminus A$, we have $\overline{\{x\}}\cup A=X$.
Let $B=\bigcap_{x\in X\setminus A}\overline{\{x\}}$. Then clearly $B=\overline{\{x\}}$ for all $x\in X\setminus A$.
Now pick a closed interval $I$ disjoint from $C_A$. Let $C=C_A\cup I$.
Enumerate $X\setminus A=\{x_1,\ldots, x_m\}$.
Use the corollary to split $I$ into $m$ sets $I_1,\ldots, I_m$. Likewise, for each $x\in A$, split $\mu_A(x)$ into $m+1$ sets $\mu_A(x)_0,\ldots, \mu_A(x)_m$.
Now define $\mu\colon X\to\mathcal P(C)$ as
$$\mu(x)=\begin{cases}\mu_A(x)&\text{if }x\in A\setminus B\\
\mu_A(x)_0&\text{if }x\in A\cap B\\
I_i\cup\bigcup_{x\in B\cap A}\mu_A(x)_i&\text{if } x=x_i\in X\setminus A\end{cases} $$
One verifies (straightforward, but with a couple of case distinctions) that $\mu$ has the desired properties. $\square$