When does injectivity imply surjectivity?

The function $f(x) = \arctan x$ is injective but clearly not surjective on $\mathbb{R}$.


In general, it is true that every Dedekind-infinite set has this property.


$f(x)=\arctan x$, for example, is injective but not surjective.


For your second question, let $S$ be an infinite set and $f:S\to S$ be any injection. Then fix some $x_0$ in $S$. Then, since $S$ is infinite, $|S|=|S\setminus\{x_0\}|$ ($|A|$ is the cardinal of a set $A$), so there exists a bijection $\phi$ of $S$ onto $S\setminus\{x_0\}$. Then $\phi\circ f$ seen as an application from $S$ into $S$ is injective but not surjective.

Note: usual definition of cardinals require the Axiom of Choice. We don't need the whole theory of cardinals here, but I don't whether AC is necessary or not.