How can one prove that for all sets A and B, if A and B are nonempty and A X B = B x A, then A = B.
No, x and y are even from different sets (like apples and oranges).x = y ??
OK, so you need to prove that A = B. It is sufficient to show that every element of A is an element of B, and conversely. Let's prove the first part.
What is the standard beginning of a proof of a statement of the following form: "Every such-and-such object has such-and-such property"? It's "Let's fix any such-and-such object". Write in symbols what this means here.
Next, B is nonempty, so choose some element. Now we have one element from A, one from B. What can we form from them?
OK, now A x B = B x A, so this object we formed is also in B x A. Now use Plato's remark. This should conclude the proof that A is a subset of B. The opposite inclusion is similar.