Let $F: \mathbb Z \rightarrow \mathbb N$ be defined by $F(n) = \begin{cases} 2x, & x\ge 0 \\ -2x-1, & x\lt 0 \end{cases} $. Prove that $F$ is onto.
I Considered $y \in \mathbb N$. To find $x$ for which $F(x) =y$, $y=2x$, $x=\frac{y}{2}$ and then $F(x)=y$ and now I need to consider other 2 cases – $y$ even and $y$ odd. (stuck)
Can you help me out?
You write the first part of the answer yourself.
If $y$ is even, $y=2k$, then we use $x=k$ Since $y$ is positive, so is $k$ $$f(k)=2k=y$$
If $y$ is odd, $y=2k-1$, then we use $x=-k$. Since $y\geq1$, $k\geq1$ and $-k\leq-1$. $$f(-k)=-2(-k)-1=2k-1=y$$