Given $f : N\to N\; given\; by\; f(x)\; = x^2$

Let $x$ and $y$ be two elements in $Z$.

Step1: Injective or One-One function:

For an injective or one-one function, $f(x) = f(y)$

$ \Rightarrow x^2 = y^2$$ \Rightarrow x = y.$

Therefore $f:Z \rightarrow Z$ defined by $f(x)=x^2$ is one-one or injective.

Step 2: Surjective or On-to function:

For an on-to function, for every $y \in Y$, there exists an element x in X such that $f(x) = y$.

$ \Rightarrow$ For every $y \in Z$ there must exist $ x$ such that $ f(x)=x^2= y$.

However, we see that for $y=2$, there is no $x \in Z$ such that $f(x) = x^2 = 2$.

Therefore $f:Z \rightarrow Z$ defined by $f(x)=x^2$ is not onto or surjective.

Solution: $f:Z \rightarrow Z$ defined by $f(x)=x^2$ is only one-one or injective but not onto or surjective.