(A) Suppose $f(x_1) = f(x_2)$.
If $x_1$ is odd and $x_2$ is even,then $x_1+1 = x_2-1$,which implies $x_2-x_1 = 2$. Since $x_1$ is odd and $x_2$ is even,the difference between an even and an odd number is always odd,so $x_2-x_1$ cannot be $2$. Thus,this case is impossible.
Similarly,if $x_1$ is even and $x_2$ is odd,$x_1-1 = x_2+1$,implying $x_1-x_2 = 2$,which is also impossible.
Therefore,$x_1$ and $x_2$ must be both odd or both even.
If both are odd,$f(x_1) = f(x_2) \Rightarrow x_1+1 = x_2+1 \Rightarrow x_1 = x_2$.
If both are even,$f(x_1) = f(x_2) \Rightarrow x_1-1 = x_2-1 \Rightarrow x_1 = x_2$.
Thus,$f$ is one-one.
For onto,consider any $y \in N$. If $y$ is odd,$y = 2r+1$ for some $r \ge 0$. Then $f(2r+2) = (2r+2)-1 = 2r+1 = y$. If $y$ is even,$y = 2r$ for some $r \ge 1$. Then $f(2r-1) = (2r-1)+1 = 2r = y$. Since every $y \in N$ has a pre-image in $N$,$f$ is onto.