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.