Recall that:

This limit exists if and only if both the left handed limit and right handed limits exist. We know that the left handed limit exist as we would simply take f'(x) = 2x and plug in x = 2 to get f'(2) = 4.

Now to take care of the right-handed limit. This means that f(x) = x + 2 must have the same derivative/limit at x = 2 even if it isn't defined there for this particular function. So:

Now, since the derivative now it exists, the function must be continuous (a theorem you should know). So, evaluating f(2) = (2)^2 = 4. This indicates that f(2) = m(2) + b = 4 too. Since you solved for m, you can solve for b.