Problem.
Suppose [imath]f:\mathbb{Z}\rightarrow\mathbb{Z}[/imath] given by
[math]f(n)=\begin{cases} \frac{n}{2}&\text{if}~n~\text{is even}\\ \frac{n+1}{2}&\text{if}~n~\text{is odd}\end{cases}[/math]
Determine if the function is injective or surjective.
My attempt: By evaluating the function we see that each output repeats twice. Hence to show that the function is not injective is simple, since [imath]f(0)=0[/imath] and [imath]f(-1)=0[/imath] but [imath]0\neq-1[/imath]. However, I find it difficult to prove that the function is surjective. The goal is to show that [imath]f(\mathbb{Z})=\mathbb{Z}[/imath].
My first thought was to suppose we partitioned [imath]\mathbb{Z}=\mathbb{Z_1}\cup\mathbb{Z_2}[/imath]. Where [imath]\mathbb{Z_1}[/imath] is the odd integers and [imath]\mathbb{Z_2}[/imath] the even integers. And so [imath]\mathbb{Z_1}=2t+1[/imath] and [imath]\mathbb{Z_2}=2t[/imath] for some integer [imath]t[/imath]. Then for each case, we have
[math]f(\mathbb{Z_1})=f(2t+1)=t+1[/math] And
[math]f(\mathbb{Z_2})=f(2t)=t[/math]
Now if [imath]t[/imath] is even, then [imath]t+1[/imath] is odd. And if [imath]t[/imath] is odd, then [imath]t+1[/imath] is even. Then clearly as [imath]t[/imath] varies over all integers, so will the [imath]f(n)[/imath] vary over all integers as well. Hence it must be true that [imath]f(\mathbb{Z})=\mathbb{Z}[/imath].
I know this is not a correct proof, but it was my attempt anyway.
Suppose [imath]f:\mathbb{Z}\rightarrow\mathbb{Z}[/imath] given by
[math]f(n)=\begin{cases} \frac{n}{2}&\text{if}~n~\text{is even}\\ \frac{n+1}{2}&\text{if}~n~\text{is odd}\end{cases}[/math]
Determine if the function is injective or surjective.
My attempt: By evaluating the function we see that each output repeats twice. Hence to show that the function is not injective is simple, since [imath]f(0)=0[/imath] and [imath]f(-1)=0[/imath] but [imath]0\neq-1[/imath]. However, I find it difficult to prove that the function is surjective. The goal is to show that [imath]f(\mathbb{Z})=\mathbb{Z}[/imath].
My first thought was to suppose we partitioned [imath]\mathbb{Z}=\mathbb{Z_1}\cup\mathbb{Z_2}[/imath]. Where [imath]\mathbb{Z_1}[/imath] is the odd integers and [imath]\mathbb{Z_2}[/imath] the even integers. And so [imath]\mathbb{Z_1}=2t+1[/imath] and [imath]\mathbb{Z_2}=2t[/imath] for some integer [imath]t[/imath]. Then for each case, we have
[math]f(\mathbb{Z_1})=f(2t+1)=t+1[/math] And
[math]f(\mathbb{Z_2})=f(2t)=t[/math]
Now if [imath]t[/imath] is even, then [imath]t+1[/imath] is odd. And if [imath]t[/imath] is odd, then [imath]t+1[/imath] is even. Then clearly as [imath]t[/imath] varies over all integers, so will the [imath]f(n)[/imath] vary over all integers as well. Hence it must be true that [imath]f(\mathbb{Z})=\mathbb{Z}[/imath].
I know this is not a correct proof, but it was my attempt anyway.
Last edited: