I cannot prove this rather simple theorem in set theory.
Let $A$ be a finite set. If $f: A \to A$ is injective, then $f$ is also surjective.
My Attempt. Suppose for contradiction that this isnt the case. So there exists a mapping $f: A \to A$ that is not surjective. Then the image of $A$ under $f$ is a proper subset of $A$, i.e., $\text{Im}(f) = C$, where $C \subsetneq A$. Define the mapping $g: C \to A$, where $c \mapsto f^{-1} (\{c\})$. By construction, $g$ is not onto, but since $f$ is injective, it is well-defined, since every $c \in C$ has a unique preimage in $A$. Hence, every $c$ is sent to exactly one $a \in A$. But, if that is the case, $|C| = |A|$, as a function is by definition defined on its entire domain. With this contradiction, we conclude that no such function $f$ can exist.
Your proof is correct, but using a proof by contradiction makes it unnecessarily complicated.
Since $f$ is injective, no two distinct elements of $A$ are mapped to the same element. Hence $|f(A)| = |A|$. As $A$ is finite, $f$ must be surjective.