While it wasn't explicitly asked, I feel it's worth mentioning, as there was some question about this in the comments.
Theorem. $\sf ZF$ proves that $A<B\to A^2<B^2$ implies the axiom of choice.
Proof.
Recall Tarski's lemma, if $\lambda$ is an well-ordered cardinal and $x$ is any set, then $|X|+\lambda=|X|\cdot\lambda$ implies that $|X|$ is comparable with $\lambda$.
Lemma 1. Suppose that $x=|X|$ and $y=|X|$ are cardinals of non-empty sets such that $x^2=x$ and $y^2=y$, then $(x+y)^2=xy$.
Proof of Lemma 1. First note that if $x^2=x$, then $x+x=x+1=x$. Next, we have the following: $$(x+y)^2=x^2+2xy+y^2=x+xy+y.$$
But since $x+1=x$ and $y+1=y$, we get: $$xy=(x+1)(y+1)=xy+x+y+1=xy+x+y=(x+y)^2.\quad\square$$
Next, suppose that $X$ is any set, then $X^\omega$ satisfies that $|(X^\omega)^2|=|X^\omega|$, and $\lambda=\aleph(X^\omega)$—the least infinite cardinal which cannot be injectively mapped into $X^\omega$—satisfies this also. Let $A=X^\omega+\lambda$ and $B=X^\omega\times\lambda$.
If $|A|<|B|$, then by the assumption $|A|^2<|B|^2$. But this contradicts Lemma 1. Therefore $|A|=|B|$, and then by Tarski's lemma it has to be the case that $X^\omega$ can be well-ordered, and thus $X$ can be well-ordered as well.$\quad\square$