If a function $f:X\to Y$ is injective, and $|X| = |Y|$, can it not be bijective? For proving a function to be a bijection, we usually prove it is injective and that it is surjective. However, if I can prove that it is injective, and that $|X| = |Y|$ would that be sufficient?
As far as I understand, the only way it wont be surjective, when $|X| = |Y|$ and it is injective, is if some $x$ dont have $y$
Is that possible?
 A: In the finite case, this is true.
If $X$ and $Y$ are infinite it is not true. For example:
$f:\mathbb{N}\to\mathbb{N}, n\mapsto n+1$. This function is injective, but not surjective, as $0$ has no preimage.
Edit: So you are correct. If the sets $X,Y$ have a finite and equal cardinality, it is enough to proof that $f$ is either injective, or surjective.
There are some common examples for this method.
When you want to proof that a finite integral domain is a field, for example, this method can be used to great success. In that case you have to proof that every element has an inverse, and you can conclude that from looking at a certain bijective map.
A: There is a fairly critical piece of information needed to conclude that an injection $f:X\to Y$ must be a bijection if $|X|=|Y|.$ In particular, we need to know that $X$ (and
hence, $Y$) are what is called "Dedekind-Finite," meaning that no proper subset of $X$ has the same cardinality as $X$ does, or (equivalently) that $X$ has no countably-infinite subset.
Every finite set satisfies this property, but it's quite possible that some infinite sets do, too.
