The way I would do it would be more like this.
Let ε >0, and let L = lim f(x) as x -> P
Let xn be a sequence in dom(g) converging to p. Then there exists an N1 such that n > N1 implies |xn-p| < r. For such xn, g(xn) = f(xn). Since lim(f) exists at p and the limit is L, then there exists an N2>N1 such that n>N2 implies |f(xn)-L|<ε
Let N =N2 Then n>N implies |f(xn)-L| = |g(xn)-L| < ε. Thus, lim g(x) = L
(Note that it's important that N2>N1 (or equal to). Otherwise f(xn) may not be equal to g(xn) for n>N2 (in fact, f(xn) may not even be defined)).