What ZF axioms does Cantor's diagonal argument require? What ZF axioms does Cantor's diagonal argument require? Cantor's diagonal argument is often presented without reference to any of ZF axioms, so comes my question.
For this question, I will limit to the scope to uncountability of the set of real numbers.
 A: The main axiom involved is Separation: given a formula $\varphi$ with parameters and a set $x$, the collection of $y\in x$ satisfying $\varphi$ is a set. (The set $x$ here is crucial - if we wanted the collection of all $y$ such that $\varphi(y)$ holds to be a set, this would lead to a contradiction via Russell's paradox.)
The way this is applied is as follows: suppose $f: \mathbb{N}\rightarrow\mathbb{R}$. We apply Separation to $\mathbb{N}$: let $\varphi(x)$ be the formula "$x\not\in f(x)$". (Note that this uses $f$ as a parameter.) Applied to $\mathbb{N}$, this gives a set $A$ which cannot be in the range of $f$, since $A=f(n)$ implies $n\in A\iff n\not\in f(n)\iff n\not\in A$.
Incidentally, this does not require that $\mathbb{R}$ exist as a set. $\mathbb{R}$ is a definable class even if it is not a set, and we can phrase Cantor's theorem as "For any function with domain $\mathbb{N}$, there is a real not in the range of the function". So Powerset plays no role here. Neither does Replacement, since we don't need the range of $f$ to be a set. Pairing is also irrelevant - although dropping pairing means we might not have functions at all, that just makes Cantor's result vacuously true. Union and Foundation didn't show up at all, and - perhaps surprisingly - we never used Extensionality either: we merely needed the converse, that two equal sets have the same elements, and this is a consequence of the laws of first-order logic alone.
If, however, you want the theorem to exist in the right context, then Powerset, Pairing, and Extensionality should all be assumed - Extensionality so that sets mean what they should, and Powerset and Pairing so that $\mathbb{R}$ and some functions exist in the first place.
