[Math] Why is this function neither injective nor surjective

algebra-precalculusfunctions

Hello guys I am doing some maths revision and I am stuck. I read and I saw videos and I still can't get my head around it.

I have this example:

Determine whenever this function $\mathbb{Z}\to\mathbb{Z}$ is injective, surjective, neither, both:

$$f(x) = n^2 + 1$$

In the answer it is given that is neither without explaining why not.

If I substitute $n$ with $1$, I will get $f(1) = 2$ and, with $-1$, $f(-1) = 2$ again. So that should be surjective but it says is neither?

Best Answer

The fact that $f(1)=f(-1)$ implies that $f$ is not injective.

Then $n^2+1>0, \forall n\in \mathbb{Z}$, so $f(\mathbb{Z}) \subseteq \mathbb{N}$ so f is not surjective.(=there exists a so that for all b $\in \mathbb{Z}$ $f(b) \ne a$ ; ex : $a=-1$)

Related Question