It's a limit, so we're not concerned with what happens at x=1. We're concerned with what happens as we approach x=1.
The part of f(x) that talks about approaching x=1 is x^2 + 2.
If you plug x=1 into that you get (1)^2 + 2 = 3, so the limit of f(x) as x approached 1 is 3.