I take it the question is to find the limit of the function as x approaches 2.
It doesn't matter whether (2, f(2)) is a point on a continuous function, or is an isolated point off a continuous function f, or doesn't exist at all. In any of those cases, the limit exists as long as the limit as x approaches 2 from the left exists, the limit as x approaches 2 from the right exists, and those two limits are the same. What's happening at 2 itself is irrelevant. And that's why it's OK to cancel the (x-2)'s! Because we only care about what's happening from the left and from the right of 2, not at 2 itself.