The mapping is supposed to be from $\mathbb{N}$ to $\mathbb{N}$.
I'm still trying to understand if this is possible, I mean if it was from $\mathbb{R}$ to $\mathbb{N}$, I guess $x^2$ would work.
The mapping is supposed to be from $\mathbb{N}$ to $\mathbb{N}$.
I'm still trying to understand if this is possible, I mean if it was from $\mathbb{R}$ to $\mathbb{N}$, I guess $x^2$ would work.
Let $f(1) = 1$ and $f(n) = n-1$ for all $n \geq 2$.
The function is not injective since $f(1) = f(2)$, but $1\neq 2$.
If $n \in \mathbb N$, then $f(n+1) = n+1-1 = n$ so that $f$ is surjective.