Problem: Let $(M,d)$ be a metric space where $A,B\subset M$. If $\overline X$ is the closure of $X$, find two sets $A$, $B$ that satisfy $ \overline A \cap B,\;\; A \cap \overline{B},\;\; \overline{A\cap B},\;\; \overline A \cap \overline B $ are all different.
My solution: I've intuitively (I really don't know how) found that $A=\cup_{n\in\mathbb{N}^+}\{\frac{1}{n}\}\cup (2,3)\cup \{4\}$, and $B=(3,4) \cup \{0\}$ are solutions to this problem, since $\overline A \cap B = \{0\}$, $ A \cap \overline B = \{4\}$, $\overline {A \cap B} = \emptyset$ and $\overline A \cap \overline B = \{0,3,4\}$, but is there a more elegant/simpler solution?. How do I find a solution analytically? Any hint?
Thanks in advance.