According to this post, we need the axiom of separation to show that $\{x,x\} = \{x\}$.
I struggle to see why this is so. It seems to me the axiom of pairing allows us to construct a set $X$ such that
$$y\in X \iff (y = x \lor y = x)$$
yet the latter condition is equivalent in first-order logic to $y=x$, hence
$$y\in X \iff y = x.$$