Is a function in the form of $f(x) = (x^2, x + 1)$ injective or surjective? I understand the method used to prove injectivity or surjectivity, however, I am confused as to how to handle a function that presents itself as a set $(m,n)$.
In the example, $f:Z \rightarrow Z \times Z$, $f(x) = (x^2,  x + 1)$
We know that $x^2$ is not injective as we can find for example $f(-1) = f (1) = 1$.
However, we also know that the second part of the equation is injective as we can deduct that:
$x + 1 = y + 1$
$x = y$
The form $(m, n)$ of the function is what is really confusing me.


*

*Would it be correct to conclude that the function is injective since it will produce a set of unique $(m,n)$ values for each $x$? 

*If so, how would we define such a function to be surjective since there will exists coordinates for which there is no corresponding $x$? Would I be correct to conclude that the function is not surjective? 

*Also, if a function was in the form $f(x) = z + 5$, would it be correct to conclude that the function is not well defined, and thus we can't determine if it's surjective\injective due to the fact that it's based on a ambiguous variable $z$?
 A: Answering your questions:


*

*You are correct to assume $f$ is injective. A function $f(x)$ is injective iff $f(x) = f(y) \implies x = y$. It is true that $f$ returns two values, but the criterion is the same. If $f(x) = f(y)$, in particular the two second coordinates are the same, but like you said, $x + 1 = y + 1 \iff x = y$;

*You are correct to assert $f$ is not surjective, as there is no $x$ such that $f(x) = (-1, 1)$, for example. An example of a surjective function could be a function that goes around in a spiral (for non-negative $x$) covering all points in $\mathbb{Z}^2$. That would be $f(0) = (0, 0), f(1) = (1,0), f(2) = (1,1), f(3) = (0,1), f(4) = (-1, 1), f(5) = (-1, 0), \cdots$, but I don't know how to write that in a clean way. For $x < 0$ we could just take anything you like.

*Also right! Defining $f(x) = z+5$ is nonsensical, unless you previously stated that $z$ is some constant. In that case $f$ would be a constant function.
A: $$f:\mathbb{Z} \to \mathbb{Z}^2$$
If $f(x)=f(y)$, then we have $(x^2, x+1) =(y^2, y+1)$, hence $x+1=y+1$ of which we can conclude that $x=y$, hence it is injective.
It is not surjective, for example, $(2,3)$ is not in the image set.
As for your last question, what do you mean by $z$? I don't think it is well defined.
