Give an example of two distinct sets $A$ and $B$ such that $A \times B = B \times A$ This is a question from my textbook. The book gives the answer $A = \varnothing$ and $B = \{1\}$.
The definition of $A \times B$ is $\{(a,b): a \in A \land b \in B\}$.
But if $A = \varnothing$, what could be in it?
Even if it's $(\varnothing, 1)$ & $(1, \varnothing)$, how do you compare $\varnothing$ and $1$?

Look at the definition literally and thouroughly
$\emptyset \times B=\{(a,b)|a\in \emptyset \land b \in B\} $
As there are no $a\in \emptyset  $ there are no $(a,b)\in \emptyset\times B $.
So $\emptyset \times B=\emptyset$.
Likewise $B \times \emptyset =\emptyset $.

Furthmore if $A\ne \emptyset  $ and $B \ne \emptyset  $ then either there exists a $a \in A;a \not \in B $ or there is a $b\in B;b\not \in B $.  Or both.  
Without loss of generality we will assume there is an $a\in A; a\not \in B $.  Let $b\in B $ (any element;nothing specific).  Then $(a,b) \in A\times B $ but $(a,b) \not \in B\times A $ (as $a\not \in B $)
So we can prove if $A\times B=B\times A$ then either $A=B $ or one of the sets is empty.
