For a finite set $A$, $f : A \to A$ is a bijection if there is an inverse function $g : A \to A$ such that $$\forall x \in A\quad g(f(x)) = x$$
Proof. If $f(x) = f(x')$, then $x = g(f(x)) = g(f(x')) = x'$. Therefore, $f$ is one-to-one.
Since $f$ is one-to-one, there must be $\vert A\vert$ elements in the range of $f$. This implies that $f$ is also one-to-one
I am confused on what $f : A \to A$ is supposed to mean. I understand that $f : A \to B$ means that $\forall x$ in the domain $A$ maps to the co-domain $B$, but how does $A$ map to itself in $f : A \to A$? Also, how do we arrive at $f(x) = f(x')$ from our antecedent? To me, the statement, $f(x) = f(x')$, looks like it is not one-to-one.