Im being asked to define a bijection from the set of natural numbers including zero of non negative integers to the set of natural numbers. Then prove that the function is surjective and injective. So far I tried creating a piece wise equation where:
$$f(n) = \begin{cases}2n, &\text{if }n >= 0\\ -2n-1,& \text{if } n < 0 \end{cases}$$ I'm not sure if thats what they want but I think its correct.
If possible I would appreciate getting insight on how to do B as well because I genuinely have no clue.