Prove that $A \cup B = A \cap B$ if and only if $A=B$. Prove that $A \cup B = A \cap B$ if and only if $A=B$.
My method was:
We must prove two implications, so we will proceed by proving the first implication. We will do this by proving the contrapositive: If $A \neq B$, then $A \cup B \neq A\cap B$. So, we assume that $A \neq B$. Let $k \in A$ and $k \notin B$. Then $k$ is in $A \cup B$ and not $A \cap B$, and $A \cup B \neq A \cap B$. Therefore this is true by definition. 
Since $A = B$, for every $k \in A$, $k$ is also in $B$. Hence $A \cup B = A=B$ and $A \cap B = A=B$. Therefore, $A \cup B = A \cap B$.
I know I'm close in the first part of the proof, but I am not sure about the second part when I try to prove the other direction.
 A: Note that $A\cap B\subseteq A,B\subseteq A\cup B$ so equality at the ends gives equality throughout. 
A: Assuming $A$ and $B$ are non-empty, in your first part you are almost right. 
You are assuming $A\neq B$ implies that your $k$ exists, but there might not be a $k$ such that $k\in A$ but $k\notin B$ (For example if $A\subset B$). So technically $A\neq B$ implies two cases: Either $\exists \, k$ such that $k\in A $ but $k\notin B$ or $\exists \, k$ such that $k \in B$ but $k\notin A$. You need to check both cases. Your logic is correct though for the first case, and the other case is practically identical.
Now for the second part. You are proving that $A\cup B \neq A\cap B \Rightarrow A\neq B$. Now since $A\cup B \neq A\cap B$, we have two cases again. First, assume $x\in (A\cup B)$ but $x \notin (A\cap B)$ and show that $A\neq B$. Then assume $x\in (A\cap B)$ but $x \notin (A\cup B)$ and show that $A\neq B$.  
A: Proof of this $"\implies"$ direction, i.e. we will show that when $A\cup B = A \cap B\implies A = B$. Actually, in order to prove the equality, we are going to prove that $A\subseteq B $ and $B \subseteq A.$
Let $x \in A \implies x \in A\cup B \implies x \in A\cap B \implies x \in B\implies A\subseteq B.$
Let $y \in B \implies y \in A \cup B \implies y \in A\cap B \implies y \in A\implies B\subseteq A.$
Thus,  $A = B$.

The other direction is straight forward, since:
$$ A \cap B = A \cap A = A \text{ and } A\cup B = A\cup A = A.$$
Hence, $A\cup B = A \cap B$.
A: The first part is easy, and more or less as you said:
If $A=B$ then $A \cup B = A \cup A = A = A \cap A = A \cap B$.
For the converse, we can avoid dealing with elements or special cases by arguing as follows. Suppose that $A \cup B = A \cap B$.
As $A \subseteq A \cup B$ and $A \cap B \subseteq B$, this means that
$$A \subseteq A \cup B = A \cap B \subseteq B$$
Similarly, $B \subseteq A \cup B$ and $A \cap B \subseteq A$, so
$$B \subseteq A \cup B = A \cap B \subseteq A$$
We have shown that $A \subseteq B$ and $B \subseteq A$, so $A = B$.
A: *

*from $A\neq B,$ you should conclude $A\nsubseteq B,$ or $B\nsubseteq A.$ you cant conclude only one. You check one case; the other is similar (As in my solution).   

*(At least) You should add to this statement "Since $A = B$, for every $k \in A$, $k$ is also in $B$", this one: "and for every $k \in B$, $k$ is also in $A$"

Simple Solution. Similar to what I said here: (the middle $\subseteq$ changed to $=$)  
$$A\subseteq A\cup B=A\cap B \subseteq B.$$
Similarly $B\subseteq A.$ Hence $A=B$
