Show that if $ \ A \cup B = A$ and $ \ A\cap B = A$ then $ \ A = B$ Question:

Show that if $ \ A \cup B = A$ and $ \ A\cap  B = A$ then $ \ A = B$

My attempt:

Proof by contradiction:

Assume $ \ A \cup B = A$ and $ \ A\cap  B = A$ and $ \ A \neq B$ 

Case 1: $ \exists \ x \in A, x\notin B$

If $ x \in A \implies x\in A \cap B \implies x \in A \ and \  x\in B 
\implies x\in B$, a contradiction. 

Case 2: $ \exists \ x \in B, x\notin A$

If $ \ x \in B \implies x\in A \cup B \implies x\in A$, since $ \ A \cup B = A$. Contradiction. 

Is this approach correct? Could someone please show me how to do a direct proof?
Your proof is correct.

Also,

$$A \cup B = A \implies B \subseteq A$$

$$A \cap B = A \implies A \subseteq B$$

Hence $A=B$.
Part 1: claim $A\subseteq B$.


Let $x\in A$. Claim $x\in B$.

Since $A\cap B=A$, $x\in A\cap B$. By the definition of intersection of two sets, we know that $x\in A$ and $x\in B$. Hence we have shown that $x\in B$. Since $x$ is arbitrary, for any $x$, if $x\in A$, then $x\in B$. Therefore, $A\subseteq B$.


  Part 2: claim $B\subseteq A$.


Let $x\in B$. Claim $x\in A$.

$x\in B$ implies that $x\in A$ or $x\in B$. By the definition of union of two sets, we know that $x\in A\cup B$. Since $A\cup B=A$, we know that $x\in A$. Since $x$ is arbitrary, for any $x$, if $x\in B$, then $x\in A$. Therefore, $B\subseteq A$.

Combine the two parts, we know that $A=B$.