Bijection example given set of integers to natural numbers with condition. State an example of a bijection $f:\mathbb{Z}\to\{ 2n \space|\space n\in\mathbb{N} \}$.
I know for a bijection the two sets must have the same cardinality. An example I came up with for this condition is:
$$
f(n)=2n^2, f:\{ ...,-3,-2,-1,0,1,2,3,... \}\to\{ 2,4,6,8,... \}
$$
But I'm not sure if this is valid or if I am missing something?
What about $f(n) =4(n+1)$ for $n\ge 0$ and $f(n)=-4n-2$ for $n \lt 0$?
To answer you question about whether your function $f$ is bijective, the anwer is no. In fact, $f(n)=2n^2$ is very well surjective, since $f(\mathbb{Z})\subset \{2,4,6,...\}$. How every, it is not injective, since, for example, $f(2)=f(-2)$ while $2\not=-2$.