I'm learning about holes in rational functions in precalculus, and I'm confused as to why they exist, having some knowledge of limits. Say I have a function $R(x)=\frac{(x-5)(x+2)}{(x+4)(x+2)}$. If I were to find where the hole lies for this function, I would plug $-2$ into $\frac{x-5}{x+4}$ which would give me a hole at $(-2, -\frac{7}{2})$. However, that turns out to be the limit of $R(x)$ (using L'Hopital's Rule):
$$\lim_{x\to -2}\frac{(x-5)(x+2)}{(x+4)(x+2)}=\lim_{x\to -2}\frac{x^2-3x-10}{x^2+6x+8}=\lim_{x\to -2}\frac{2x-3}{2x+6}=-\frac{7}{2}$$
So why is there a hole in the graph if the limit exists at $(-2, -\frac{7}{2})$? Am I misunderstanding the definition of a limit? Thanks.
The domain of definition of the function $R$ is the set of all reals $x$ such that $(x+4)(x+2)$ is not equal to $0$, to avoid division by $0$ when evaluating. This is the definition or a convention if you prefer. (One could do things differently, too, but this is what was agreed upon.)
It is true that the limit you mention exists. Therefore you could define a new function $Q(x)$ that agrees with $R(x)$ everywhere where $R$ is defined and in addition $Q(-2)= -7/2$, and this function would be a continuous function.
Thus this type of "hole" can be plugged, and one thus calls it a removable "hole" (or a removable singularity). By contrast, the "hole" at $-4$ cannot be plugged in this way.