Using the definitions, prove that the set of odd integers is countably infinite.
Definition: The set A is countably infinite if its elements can be put in a 1-1 correspondence with the set of positive integers.
The Attempt at a Solution
I am trying to think of a function that maps the positive integers into the odd integers.
The function I am coming up with is piecewise defined.
I am unsure how to type it, but...
n-2 when n is odd and n>2
-n-1 when n is even
-n when n=1
Testing some values, I got this
It looks like this works, but I am unsure how to show a piecewise defined function is 1-1 and onto. I think I am missing something.