If $ A $ is finite, then $ f : A \to A $ is injective $ \iff $ $ f $ is surjective I want to prove by induction that if $A$ is finite, then $f:A \to A$ is injective $ \iff f $ is surjective. Can you please verify my proof?
Pf:
For $ n = 0 $, $ A = \emptyset $, and there is only one function from $ A $ to $ A $, which is both surjective and injective.
Assume (by way of induction on $n$) that for all $ A $ such that $ \left|A\right| = n $, a function $ f : A \to A $ is injective $ \iff $ $ f $ is surjective. Therefore, there are exactly $ n $ elements in $ A, \, a_1 \ldots a_n $ . Add one more element to $ A, a_{n+1} $ such that $ f $ is still injective. Therefore, $ f(a_{n+1}) = a_{n+1} $, and therefore $ f $ is surjective. Add an element to $ A \setminus \{a_{n+1\}} $, call it $ a_i $, such that $ f $ is still surjective. For every $ a_m \in \{a_1 \ldots a_n\}, \, a_m $ has only one $ x \in \{a_1 \ldots a_n\} $ such that $ f(x) = a_m $. Therefore, $ f(a_i) = a_i $ and therefore, $ f $ is injective.
 A: An induction argument doesn't really help you here, it's probably simpler to just use a counting argument.
Firstly, to show $f : A \to A$ injective $\implies$ surjective, assume you have an injective function $f : A \to A$, and assume $A$ has $n$ elements. Since $f$ injective, it's image $f(A)$ will have $n$ elements, but as $f(A) \subseteq A$, and $A$ has $n$ elements, we must have that $f(A) = A$ and so $f$ is surjective.
Now to show $f : A \to A$ surjective $\implies$ injective, assume you have a surjective function $f : A \to A$, and again assume $A$ has $n$ elements. This means that $f(A) = A$ and so $f(A)$ has $n$ different elements. But now each element in $f(A)$ must be mapped to from an element in $A$ but as they both have $n$ elements, each element in $A$ must be mapped somewhere different and so $f$ is injective.
A: Let $n$ be the number of elements in $A$. We can then enumerate the elements of $A$ by $a_1, a_2,...,a_n$. Since $f$ is injective, we know that $f(a_i)\ne f(a_j)$ for $a_i\ne a_j$. If $f$ is not surjective then there exists $b\in A$ such that $f(a_i)\ne b$ for any of the $a_i$. Therefore, $f(a_i),...,f(a_n), b$ form a set of $n+1$ values. But this is impossible because $A$ only contains $n$ values. Therefore, $f$ is surjective.
