If $f$ is a one-one mapping from set $A$ to set $A$,then $f$ is onto. State true or false
$(1)$If $f$ is a one-one mapping from set $A$ to set $A$,then $f$ is onto.
$(2)$If $f$ is an onto mapping from set $A$ to set $A$,then $f$ is one-one.

I do not understand whether it is true or false.If true,why true.If false,why false.No concrete reasoning,example and counterexample comes to my mind.Please help me.Thanks.
 A: Neither is true in general if $A$ is infinite. Consider $A=\Bbb N$. Counterexamples:


*

*$n\mapsto 2n$ is injective but not surjective.

*$n\mapsto \lfloor \frac n 2 \rfloor$ is surjective but not injective, where $\lfloor x \rfloor$ is the least integer $\le x$.


However, both are true if $A$ is finite. Suppose $A$ has $n$ elements, $n\in \Bbb N$. 


*

*If $f$ is 1-1, then its image has size $n$. But $A$ has only one subset of size $n$, namely $A$ itself, so the image of $f$ is all of $A$, i.e. $f$ is surjective.

*If $f$ is onto $A$, then $\{f^{-1}(y)\mid y\in A\}$ is a partition of the domain of $f$, with every member nonempty. So $n = \sum_{y\in A} \lvert f^{-1}(y) \rvert$, and for all $y\in A$, $\lvert f^{-1}(y) \rvert \ge 1$. If any $\lvert f^{-1}(y) \rvert > 1$, then the sum would be $> n$; so for all $y\in A$, $\lvert f^{-1}(y) \rvert = 1$. Thus $f$ is injective.
A: $f: \Bbb R \to \Bbb R$, $f(x) = \exp x$ is one-one but not onto.
$f: \Bbb R \to \Bbb R$, $f(x) = x^3 - x$ is onto but not one-one.
