If the set $S$ is countably infinite, prove or disprove that if $f$ maps $S$ onto $S$ (i.e. $f\colon S\to S$ is a surjective function), then $f$ is one-to-one mapping.
Please give a formal mathematical proof for this statement.
I have a counter-example: Suppose the mapping is from $\Bbb N$ (the natural numbers, a countably infinite set) to $\Bbb N$. And $f(i) = \lceil i/2\rceil$. It is onto function but not one-one.
But I am not getting that how this mapping is onto. Intuitively, since $1$ and $2$ will be mapped to $1$; $3$ and $4$ will be mapped to $2$; $5$ and $6$ will be mapped to $3$; similarly, $n-1$ and $n$ will be mapped to $n/2$. So in the codomain, there will be some elements that have no pre-image for this countably infinite set. So, please correct me where I am wrong.