f is one-one.
Let x1,x2∈N with f(x1)=f(x2). Then
x12+x1+1=x22+x2+1
x12−x22=x2−x1
(x1−x2)(x1+x2)=−(x1−x2)
(x1−x2)(x1+x2+1)=0.
Since x1,x2∈N, each is at least 1, so x1+x2+1≥3>0 and the second factor can never be zero. Therefore x1−x2=0, i.e. x1=x2. Hence f is one-one.
f is not onto.
First note that f is strictly increasing on N: for x≥1,
f(x+1)−f(x)=((x+1)2+(x+1)+1)−(x2+x+1)=2x+2>0.
So the smallest value f takes is f(1)=1+1+1=3, and f(x)≥3 for every x∈N. The values of f are
f(1)=3,f(2)=7,f(3)=13,f(4)=21,f(5)=31, …
Now take y=1, which belongs to the codomain N. If f(x)=1 then
x2+x+1=1⇒x2+x=0⇒x(x+1)=0⇒x=0 or x=−1,
and neither 0 nor −1 is a natural number. So 1 has no pre-image in N. The same is true of 2, and of every natural number outside the list 3,7,13,21,31,…
Since some elements of the codomain are never reached, f is not onto.

Hence f is one-one but not onto.