How to establish (formally) equality of sets? The axiom of extensionality establishes that "if two sets have the same elements, then they are identical", but not the second implication (the one I will use to prove that two sets are equal).
If we try to solve this by defining "A and B are equal sets iff they have the same elements", then why do we need to establish the axiom of extensionality?
 A: The second implication is true without the axiom of extensionality.
To see why, given two sets $A,B$ suppose that $A=B$. It follows that the truth value of a sentence involving $A$ is unchanged when $A$ is substituted by $B$. Apply this to the evidently true statement

$\forall x, x \in A \iff x \in A$

by substituting $B$ in place of the second $A$, and we obtain the true statement

$\forall x, x \in A \iff x \in B$

This sentence says that $A$ and $B$ have the same elements.
A: Preliminary note : in order to prove that two sets are identical, you will use " if A and B have the same elements, they are equal". You will not use " if A = B, they have the same elements" for you cannot use as a starting point what you're supposed to prove. You need your target sentence as the consequent of the conditional you are going to use.


*

*The extensionality principle ( a biconditional statement) says two things:


(1) being coextentional ( having the same elements) is a necessary
condition for a set A and a set B to be identical ( if A = B, then A
and B have the same elements).
(2) being coextentional is a sufficient condition for them to be
identical ( if A and B have the same elements, then A = B).


*

*Assertion (1) is no surprise , as is clearly shown above. it follows from logic alone.

But assertion (2) is really a thesis with genuine content. This is why the whole statement has to be stated as an axiom.
Assertion (2) expresses the decision to consider as totally identical "two"  collections on the sole ground that they have the same members. Ths is not trivial.

*

*Consider the following  collections : $C_1$ = " the set of all extraterrestrial bodies on which man has landed before 1970 "  and $C_2$ " the set of all natural satellites of the Earth".

"These two collections are not the same, are they? Their definitions do not mean the same thing at all..."
The extensionality axiom part (2) says : yes,  they are perfectly identical, since they have exactly the same elements, namely a unique element in each case :
$C_1 = \{The \space Moon\}= C_2$.
Note : part (2) of the axiom amounts to the decision not to take into account intensional or conceptual differences between collections, but only their extensional aspect; the intension / extension distinction being inherited from traditional logic.
A: The axiom of extensionality is:
$\forall A\ \forall B: (A=B\Leftrightarrow \forall C: (C\in A\Leftrightarrow C\in B))$
It already includes both directions. There is nothing to prove here.
A: The other direction holds by definition. Suppose $A=B$. Then clearly $\forall x (x\in A \iff x\in B)$.
