Solve for one-one.
⎧⎪
⎪⎨⎪
⎪⎩n+12,is n is oddn2,is n is even, for all n ∈ N
Now for one-one.
f(1)=n+12=1+12=1 (since 1 is odd)
f(2)=22=1 (since 2 is even)
Since, f(1)=f(2)
but 1≠2
both f(1) & f(2) have same image 1
f is not one-one.
Solve for onto.
f(n)=⎧⎪
⎪⎨⎪
⎪⎩n+12,is n is oddn2,is n is even for all n ∈ N
When n is odd,
n=2k−1 for k ∈ N
f(2k−1)=2k−1+12=k
When n is even
n=2k for some k ∈ N such that
f(2)=2k2=k
Thus, for every n ∈ N,f(n) ∈ N
Therefore, f is onto.
Hence, f is onto but not bijective function.