Given f(x)=x2+x+1
To prove one-one, we will show if f(x1)=f(x2), then x1=x2
Let f(x1)=f(x2)
⇒x21+x1+1=x22+x2+1
⇒x21+x1−x22−x2=0
⇒(x1−x2)(x1+x2+1)=0
Since x1+x2+1≠0 ∀ x1,x2∈N,
we have x1−x2=0
⇒x1=x2
Thus, f(x1)=f(x2)⇒x1=x2
Hence, f is one-one.
f(x)=1 has no pre-image in R.
So, f is not onto.
f:N→S is one- one and onto.
Hence, f:N→S is invertible.
To find the inverse of f
Let f(x)=y
⇒x=f−1(y) ⋯(1)
and y=x2+x+1
⇒y=(x+12)2+34
⇒√y−34=x+12
(Taking positive root only because x∈N and hence, RHS is always positive)
⇒√y−34−12=x
⇒√y−34−12=f−1(y) [From (1)]
On replacing y with x, we get
f−1(x)=√x−34−12