© All Rights reserved @ LearnWithDash
Step-by-Step Solution
Step 1: Understand the Definition of the Function
The function is defined from the set of natural numbers ($\mathbb{N}$) to the set of integers ($\mathbb{Z}$) as follows:
$f(n) =
\begin{cases}
\dfrac{n - 1}{2}, & \text{if $n$ is odd}\\[6pt]
-\dfrac{n}{2}, & \text{if $n$ is even}
\end{cases}
$
We want to verify whether this function is one-to-one (injective) and onto (surjective).
Step 2: Prove that $f$ is One-to-One (Injective)
Case 1: Both $x$ and $y$ are even
Suppose $x$ and $y$ are even natural numbers. Then,
$
f(x) = -\dfrac{x}{2}, \quad
f(y) = -\dfrac{y}{2}.
$
If $f(x) = f(y)$, then
$
-\dfrac{x}{2} = -\dfrac{y}{2}.
$
Multiplying both sides by $-2$ gives $x = y$. Hence, $f$ is injective for even inputs.
Case 2: Both $x$ and $y$ are odd
Suppose $x$ and $y$ are odd natural numbers. Then,
$
f(x) = \dfrac{x - 1}{2}, \quad
f(y) = \dfrac{y - 1}{2}.
$
If $f(x) = f(y)$, then
$
\dfrac{x - 1}{2} = \dfrac{y - 1}{2}.
$
Multiplying both sides by $2$ gives $x - 1 = y - 1 \Rightarrow x = y$. Hence, $f$ is injective for odd inputs.
Case 3: One input is even, and the other is odd
If $f(x) = f(y)$ where $x$ is even and $y$ is odd, then:
\[
-\dfrac{x}{2} = \dfrac{y - 1}{2}.
\]
This generally cannot hold for an integer $x$ and $y$, because the left-hand side is a negative integer (or zero, if $x=0$ which is not in $\mathbb{N}$ under usual definitions) and the right-hand side is a nonnegative integer (for $y \ge 1$, $y$ odd). Thus $x$ and $y$ cannot be equal if they differ in parity.
From the above cases, $f(x)=f(y)$ implies $x=y$ for all natural numbers $x$ and $y$, so $f$ is injective.
Step 3: Prove that $f$ is Onto (Surjective)
We need to show that for every integer $z \in \mathbb{Z}$, there is some natural number $n \in \mathbb{N}$ such that $f(n) = z$.
Positive integers $z > 0$
If $z$ is a positive integer, choose $n = 2z + 1$, which is odd. Then
$
f(n) = \dfrac{(2z + 1) - 1}{2} = \dfrac{2z}{2} = z.
$
Hence every positive integer has a preimage under $f$ via an odd natural number.
Negative integers $z < 0$
If $z$ is a negative integer, write $z = -k$ where $k$ is a positive integer. Choose $n = 2k$, which is even. Then
$
f(n) = -\dfrac{2k}{2} = -k = z.
$
Hence every negative integer has a preimage under $f$ via an even natural number.
Zero $z = 0$
If we consider $0 \in \mathbb{Z}$, we look for a natural number $n$ such that $f(n) = 0$. For $n$ even,
$
f(n) = -\dfrac{n}{2}.
$
To get $f(n)=0$, set $n=0$; however, $0$ is typically not in the set of natural numbers (depending on the definition of $\mathbb{N}$). If $\mathbb{N}$ starts from $1$, then $0$ isn't attained. This depends on the convention for $\mathbb{N}$. If $1,2,3,\dots$ is taken as $\mathbb{N}$, then $f$ maps onto all nonzero integers. If the definition of $\mathbb{N}$ includes $0$, then $f(0)=0$. Thus, under the usual definition $\mathbb{N}=\{1,2,3,\dots\}$, every nonzero integer is attained by $f$, making it onto $\mathbb{Z}\setminus\{0\}$. If we consider $\mathbb{N}$ to include $0$, then $f$ also covers $0$. (Different textbooks use different conventions, so the exact statement for $0$ can vary. Often, "onto the integers" is stated for nonzero integers if we take $\mathbb{N}$ as starting from $1$.)
As per many standard definitions, if we regard $\mathbb{N}$ starting from $1$, each nonzero integer has a corresponding natural number mapping to it, which demonstrates surjectivity onto nonzero integers. For completeness, some definitions of $\mathbb{N}$ include $0$, so $0$ is also covered in that scenario. In either case, the essence is clear: the function covers all integers or all nonzero integers, depending on the convention.
Step 4: Conclusion
Combining the injectivity and surjectivity arguments, $f$ is both one-to-one and onto, thus it is a bijection (if $0$ is included in $\mathbb{N}$, then it fully covers all of $\mathbb{Z}$; if $0$ is excluded, it covers all nonzero integers).
Answer: One-one and onto both.