The function $f(x) = x - (-1)^x$ maps integers to integers. For every integer $x$, $(-1)^x$ is either $1$ or $-1$.
- If $x$ is even, $f(x) = x - 1$.
- If $x$ is odd, $f(x) = x + 1$.
Checking one-one (injectivity):
- Suppose $f(x_1) = f(x_2)$.
- If both $x_1, x_2$ are even or both are odd, then $x_1 - 1 = x_2 - 1$ or $x_1 + 1 = x_2 + 1$, implying $x_1 = x_2$.
- If one is even and the other is odd, the function values differ by at least 2, so no two different inputs produce the same output.
Thus, $f$ is one-one.
Checking onto (surjectivity):
- For any integer $y$, find $x$ such that $f(x) = y$.
- If $y$ is even, choose $x = y + 1$ (odd), then $f(x) = (y + 1) + 1 = y + 2$, no.
- Instead, better to consider for all integers the function covers all integers since it maps even $x$ to odd integers and odd $x$ to even integers, alternating coverage.
Hence, $f$ is onto.
Therefore, $f$ is both one-one and onto.