Where is the flaw in my reasoning in this proof that $\overline{A \cap B} = \overline{A} \cap \overline{B}$? Let $X$ be a topological space, and $A,B, \subset X$, then since the closure of a set may be characterized as as the smallest closed set containing the set, certainly we have $A \subset \overline{A}$ and $B \subset \overline{B}$, and hence $A \cap B \subset \overline{A} \cap \overline{B}$. Also, since $\overline{A}$ and $\overline{B}$ are closed, $\overline{A} \cap \overline{B}$ is a closed set containing $A \cap B$, and thus by definition $\overline{A} \cap \overline{B} \subset \overline{A \cap B}$.
Also, $A \cap B \subset \overline{A} \cap \overline{B} \implies \overline{A \cap B} \subset \overline{\overline{A} \cap \overline{B}} = \overline{A} \cap \overline{B}$, since the closure of a closed set is itself.
Hence, we have $\overline{A} \cap \overline{B} \subset \overline{A \cap B}$ and $\overline{A \cap B} \subset \overline{A} \cap \overline{B} \implies \overline{A \cap B} = \overline{A} \cap \overline{B}$.
However, I know this reasoning cannot be correct, because $\overline{A \cap B} = \overline{A} \cap \overline{B}$ is not true in a general topological space, so where did I go wrong with my reasoning?
 A: You incorrectly go from "$\overline{A}\cup \overline{B}$ is a closed set containing $A\cup B$" to "by definition $\overline{A}\cup \overline{B} \subset \overline{A\cup B}$".  The reason is that, as you started with, $\overline{A\cup B}$ is the smallest closed set containing $A\cup B$, so if $C$ is a closed set containing $A\cup B$, then $\overline{A\cup B} \subset C$.  You've flipped the definition.
A: It's right that, from $A\cap B\subset \overline{A}\cap\overline{B}$, you can conclude that
$$
\overline{A\cap B}\subset \overline{A}\cap\overline{B}
$$
because $\overline{A}\cap\overline{B}$ is closed.
On the other hand, you can have $A\cap B=\emptyset$, but $\overline{A}\cap\overline{B}\ne\emptyset$; the easy example is, in the real line, $A=[-1,0)$ and $B=(0,1]$.
The error is in assuming $\overline{A}\cap\overline{B}\subset\overline{A\cap B}$: it is not true, in general.
A: Here's a general strategy: You have a sequence of steps that prove a theorem you know is false, by a counterexample. Instantiate each step of the theorem with the counterexample until you find the first false statement, and you have found your error.
In this case, a counterexample might be $A=(0,1)$ and $B=(1,2)$, in which $\overline{A} \cap \overline{B}=\{1\}$ and $\overline{A \cap B}=\emptyset$. The failure is then at the assertion $\overline{A} \cap \overline{B}\subset\overline{A \cap B}$, which as other answers have pointed out does not follow from immediately previous statements in the first paragraph.
A: Consider the following sets for a counterxample:
$$A:=[0,1]\cap\mathbb{Q}, \: B=[0,1]\cap(\mathbb{R}-\mathbb{Q}).$$
Then $\overline{A\cap B}=\overline{\emptyset}=\emptyset$, on the other hand $\bar{A}\cap\bar{B}=[0,1]\cap[0,1]=[0,1]$.
