If $f\,:\,A\to A$ is surjective and not injective then what can I say about $A$'s size? Studying for my finals in Logic. Although the question is about Set Theory. In one of the previous exams, there was the following statement:

If $f\,:\,A\to A$ is injective and not surjective then the size of $A$ is infinite.

It's been a while sense I last had to deal with Set Theory. Then I saw this post If $f:A\rightarrow A$ is injective but not surjective then $A$ is infinite. which cleared some things. But I could not find explanations of the following questions:

*

*If $f\,:\,A\to A$ is surjective and not injective then what can I say about $A$'s size? is it finite?

*If $f\,:\,A\to A$ is surjective and injective then what can I say about $A$'s size? is it infinite? I guess it's more general case the the explained one so $A$ has to be infinite. Is it true?

 A: *

*If $f: A \rightarrow A$ is surjective and not injective then $A$ must be infinite. To see this let take for example the set $\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$. If you construct $f$ in such a way that it assigns even two (or more) elements to one element there is no way to make it surjective. It can be shown more formally using induction, I think.
But if $A$ is infinite then it is possible to construct $f$ so that it would be surjective and not injective. Simple example: let us consider $A = N_+$. Then let's define $f$ in this way:
$f(1) = 1$
$f(2) = 1$
$f(3) = 2$
$f(4) = 3$
$f(5) = 4$
$.....$


*Nothing can be said from the fact that $f: A \rightarrow A$ is surjective and injective. For identity is always surjective and injective and you can define identity on any set.
A: If $f: A \to A$ is surjective and not injective then $A$ must be infinite. This is a direct consequence of the 'pigeonhole principle', which says that if $A$ and $B$ are two finite sets with the same number of elements and $f:A \to B$, then $f$ is an injection $\iff$ $f$ is a surjection. Thus, if you suppose that $A$ is finite, you get an immediate contradiction through the existence of this function $f$.
As for your second question if $f$ is both surjective and injective you can tell nothing about the cardinality of $A$. For any set $A$ there is such a function (the identity for instance), and this holds irrespective of the cardinality of $A$.
