Let $A$ and $B$ be sets. Suppose that there is some set $X$ such that $A \cap X = B \cap X$ and $A \cup X = B \cup X$. Show that $A = B$. Let $A$ and $B$ be sets. Suppose that there is some set $C$ such that $A \cap C = B \cap C$ and $A \cup C = B \cup C$.
Show that $A = B$.
My sketch is the following. Suppose first that sets are non-empty and instead that $A$ were not equal to $B$. Then there must exist an element in either $A$ or $B$ that is not in the other. In particular, choose a in $A\setminus B$. Then this a must be in $A \cap C = B \cap C$. But this contradicts the fact that a was not in $B$. 
In fact, I am interested in the logic of my steps. Any comment would be helpful.
 A: $a \in A\backslash B $ does not imply that $a \in A \cap C$. For example, if $A = \{ 1, 2, 3 \}$, $B= \{ 3, 4, 5 \}$, $C=\{1, 3, 5 \}$.
Rather, it would be helpful to prove that $x \in A $ implies $x \in B$ and vice versa.
If $x \in A$, then $x \in A \cup C$, so $x \in B \cup C$, which is equivalent to $x \in B$ or $x \in C$.
If $x \in B$, we are done. If $x \in C$, then $x \in A \cap C$, so $x \in B \cap C$. This implies $x \in B$. Therefore, we can conclude $A \subset B$. Can you prove the converse?(Just interchange the role of $A$ and $B$.)
A: 1) $A$ and $B$ could be empty.
2) $A \setminus B$ could be empty even if $A$ and $B$ are not. (Although $A\setminus B$ and $B \setminus A$ can not both be empty if $A \ne B$ [even if one or the other of $A$ or $B$ is empty.])
3) If $a \in A\setminus B$ then $a \not \in B$ so $a \not \in B\cap C=A \cap C$.  I have utterly no idea why you would say such a thing.
But if $a \in A \setminus B$ then $a \not \in B$ so $a \not \in B \cap C = A \cap C$.  As $a \in A$ then $a \not \in A \cap C$ means $a \not \in C$.  But $a \in A \cup C = B \cup C$.  So $a \in B$ or $a \in C$.  But we showed neither of those are possible.
So $A \setminus B = \emptyset$ and so $A \subset B$.
Likewise the exact same argument shows that $B \setminus A$ is empty.  So $B \subset A$.
But I'd do it directly in the exact manner that bellcircle did.
