Axiom of Choice implies Well-Ordering Principle

Here's the usual approach. Define $G$ on ordinals, rather than arbitrary sets, by transfinite recursion. Explicitly $$G(\alpha):=f(\{x\in A|\forall\beta\in\alpha (G(\beta)\ne x)\}).$$Obviously, $G$ never takes the same value twice.

If $G(\alpha)$ exists for every ordinal $\alpha$, all ordinals can be injected into $A$, contradicting replacement and the Burali-Forti paradox.

Therefore $G(\alpha)$ is undefined for some minimal ordinal $\alpha$, and then $\{x\in A|\forall\beta\in\alpha (G(\beta)\ne x)\}=\emptyset$ (because $f(B)$ exists for any non-empty subset of $A$), i.e. $A=\{G(\beta)|\beta\in\alpha\}$. This provides a well-ordering of $A$ isomorphic to the $\in$ ordering of $\alpha$.

Incidentally, the well-ordering principle also implies the axiom of choice. To invent a choice function $f$ on some set $X$ with $\emptyset\not\in X$, well-order $Y:=\bigcup X$. Any $y\in X$ is a non-empty subset of $Y$. Then define $f(y)$ as the minimum element of $y$.