Consider the function $f: \mathbb{N} \to \mathbb{N}$ (where $\mathbb{N}$ is the set of all natural numbers, zero included) defined as follows $$f(x) = (x+3)^{2} - 9.$$ Is the function injective and/or surjective?
How can I prove it?
I know that a function is injective if for all $x,y\in\mathbb{N}$ s.t. $f(x)=f(y)$ then $x=y$. So, if I put $(x+3)^2-9=(y+3)^2-9$, how can I obtain $x=y$? Furthermore, how can I find the inverse of $f(x)$?
Note that the function $f\colon \mathbb{N} \to \mathbb{N}$ is not surjective. Indeed, there does not exist $x\in\mathbb{N}$ such that $$ f(x)= (x+3)^{2} - 9=2. $$ If there was such an $x$, then $\sqrt{11}$ would be an integer a contradiction. It is injective. Indeed $$ (x+3)^{2} - 9=(y+3)^{2} - 9\implies |x+3|=|y+3| \implies x=y $$ since $x,y\geq 0$.