I know that $|\mathbb{N}| = |\mathbb{N}^2|$, and that $|\mathbb{R}| = |\mathbb{R}^2|$. It seems like this might be true for all sets, but I don't know how to go about proving this.
It's easy to prove that $|A| \leq |A \times A|$ (see this question). So to prove the claim it suffices to show that there exists some injective function $f : A \times A \to A$.
For $A = \mathbb{N}$, you can use e.g. $f:p, q \mapsto (p+q)^2 + p$. For $A = \mathbb{R}$ you can construct various space-filling curves. But I'm not sure how such constructive solutions can be generalized, if at all.
Any suggestions on how to approach this?