I am unsure about how to solve this problem with a natural numbers domain.
The question is: Give an example of a function $f:\mathbb{N} \rightarrow \{x\in \mathbb{Z} :x\text{ is even} \}$ that is bijective.
This question is obvious to me with integers domain, but with natural numbers, I'm unsure how to include zero (an integer) as well as all negative integers while maintaining a positive domain. How should I approach this?
P.S. Natural numbers do not include zero here.
Thanks!
Hint: Use a piecewise function.
Partition the domain (non-zero naturals) into two parts, such as odd and even numbers, bijectively mapping one part onto the non-negative even integers and the other part onto the negative even itegers.
$$f(x)=\begin{cases}\Box &:& x\in 2\Bbb N\\\Box &:& x\in 2\Bbb N-1\\ \textsf{undef}&:& x\notin\Bbb N\end{cases} \\ f(2\Bbb N)=2\Bbb Z^+{\cup\{0\}}\\ f(2\Bbb N-1)=-2\Bbb Z^-$$