Check the injectivity and surjectivity of the following functions:
f:Z→Z given by f(x)=x2
f:Z→Z is given by f(x)=x2
It is seen that f(-1)=f(1)=1 but −1≠1.
Therefore f is not injective.
Now, −2∈Z. But there does not exist any elements x∈Z such that f(x)=x2=−2.
Therefore, f is not surjective.
Hence, function f is neither injective nor surjective.