If mapping is surjective, then it's injective in finite sets. If the set has a finite number of elements, prove the following:
If $\sigma$ maps $S$ onto $S$, then $\sigma$ is one-to-one.
Proof: Suppose $\sigma$ is not 1-1, then $\exists x_1, x_2$ $(x_1\neq x_2)$ such that $\sigma(x_1)=\sigma(x_2)$. Thus $|\sigma(S)|\leqslant n-1$ and since $\sigma$ is onto, then $|S|\leqslant n-1$. This is a contradiction because $|S|=n$.
Is this proof correct?
However, this is false is set is infinite. Let's consider $\sigma: \mathbb{R}\to \mathbb{R}_{\geqslant 0}$ defining by $\sigma(x)=x^2$. It is onto but not 1-1.
 A: I find it questionable, not in that there are any serious flaws in it, but because it seem to be inconsistent in assumptions on what's obvious.
What you do is without justification claim that $|\sigma(S)|\le n-1$ which of course is true (for nonempty $S$), but it's about as obvious as the statement you're proving. If you're to prove this you must justify this.
As for your counter example it isn't really good as it's not on the form $S\to S$. Instead you could use for example $f:\mathbb R\to\mathbb R$ defined as:
$$f(x)=\begin{cases}
\tan x & \text{ whenever defined}\\
0      & \text{ otherwise}
\end{cases}$$
An alternative way to prove it is to use the definition directly that is prove the existence of a bijection to a proper subset of $S$ if the map is not injective. To prove that there's an surjection from a proper subset you just define it from $\sigma:S\setminus\{x_2\}\to S$ and to prove an injection you take $\iota:S\setminus\{x_2\}\to S$ (the identity map) and then by Schröder-Bernstein theorem there's a bijection from $S\setminus\{x_2\}\to S$ and then $S$ is infinite.
