Given f:N→A such that
f(2n−1)=0 and f(2n)=1
So, image of all even natural numbers is 1 and image of all odd natural numbers is 0.
Thus, distinct elements of N has same image in A.
Hence, f is many-one.
Since, R(f)={0,1}
which is equal to co-domain A.
Hence, f is onto.