We show X = Y by proving that both X ⊆ Y and Y ⊆ X. Assume X ∪ Y = X ∩ Y.
• Prove X ⊆ Y :
Let x ∈ X. Since X ⊆ X ∪ Y, we know x ∈ X ∪ Y. But X ∪ Y = X ∩ Y, which means x ∈ X ∩ Y, and by definition of intersection, x ∈ Y. Therefore X ⊆ Y.
• Prove Y ⊆ X :
This proof is the same, just swap X with Y in the previous one.
Hence X = Y.