I would disagree that "we must plug in $2$". What is really going on is that you are breaking up the problem into simpler limits that can be done as if "by plugging in". Here are a few of the ideas that are going on "behind the scenes":
Theorem 1. Let $f$ and $g$ be functions defined on an open interval $I$ that contains $a$. If $f(x)=g(x)$ for all $x\in I$, except perhaps at $x=a$, then
$$\lim_{x\to a}\;f(x) = \lim_{x\to a}\;g(x),$$
in the sense that either they both exist and are equal, or neither one exists.
The idea here is that the limit of a function depends only on what happens near the point, not at at the point. If you know the definition of a limit using $\epsilon$s and $\delta$s, this is more or less immediate, since we always exclude the case $x=a$ explicitly in that definition.
Theorem 2. Some easy limits:
- $\displaystyle \lim_{x\to a}\; k = k$, where $k$ is a constant.
- $\displaystyle \lim_{x\to a}\; x = a$.
Note that we are not "really" plugging in $a$ in these two limits; these are limits that can be computed using the definition of limit.
Theorem 3. Decomposing complicated limits into simpler ones: if $f$ and $g$ are functions, and $\lim\limits_{x\to a}\;f(x) = L$ and $\lim\limits_{x\to a}\;g(x)=M$, then:
- $\lim\limits_{x\to a}\Bigl(f(x)+g(x)\Bigr) = L+M$.
- $\lim\limits_{x\to a}\Bigl(f(x)-g(x)\Bigr) = L-M$.
- $\lim\limits_{x\to a}\Bigl(\alpha f(x)\Bigr) = \alpha L$ for any constant $\alpha$.
- $\lim\limits_{x\to a}\Bigl(f(x)g(x)\Bigr) = LM$.
- If $M\neq 0$, then $\displaystyle \lim\limits_{x\to a}\;\frac{f(x)}{g(x)} = \frac{L}{M}$.
These are the things you use to determine
$$\lim\limits_{x\to 2}\frac{x^2-4}{x-2}.$$
Let $f(x) = \frac{x^2-4}{x-2}$ and $g(x) = x+2$. Then $f(x)$ and $g(x)$ are different functions ($g(x)$ is defined everywhere, but $f(x)$ is only defined on $(-\infty,2)\cup(2,\infty)$ ), but at any $x\neq 2$, $f$ and $g$ have the same value. That means that, by Theorem 1, we must have
$$\lim_{x\to 2}\;f(x) = \lim_{x\to 2}\;g(x).$$
Now, $\lim\limits_{x\to 2}\;g(x) = \lim\limits_{x\to 2}\bigl( x + 2\bigr)$. By Theorem 3, part 1, we know that
$$\lim_{x\to 2}\;g(x) =\lim\limits_{x\to 2}\bigl(x + 2\bigr) = \left(\lim_{x\to 2}\; x\right) + \left(\lim_{x\to 2}\; 2\right),$$
provided both limits on the right exist. By Theorem 2 above, we know that $\lim\limits_{x\to 2} \;x = 2$ and $\lim\limits_{x\to 2}\;2 = 2$. So:
$$\lim_{x\to 2}\;f(x) = \lim_{x\to 2}\;g(x) = \left(\lim_{x\to 2}\;x\right) + \left(\lim_{x\to 2}\;2\right) = 2 + 2= 4.$$
Each equality is justified by a theorem. Nowhere are we "plugging in", neither $2$ nor numbers close to $2$; we are evaluating limits using the definition and some results that afford us some short-cuts.
Where does that idea of "plugging in" come in? Because there is a class of functions for which limits can essentially be computed by "plugging in". These are the continuous functions.
Definition. Let $f(x)$ be a function, and let $a$ be a number. Then $f(x)$ is continuous at $a$ if and only if three things happen:
- $f$ is defined at $a$;
- $\lim\limits_{x\to a}\;f(x)$ exists; and
- $\lim\limits_{x\to a}\;f(x) = f(a)$.
If $I$ is an interval, we say $f$ is "continuous on $I$" if it is continuous at every $a\in I$; we say $f$ is "continuous" if it is continuous at every point of its domain; we say $f$ is "continuous everywhere" if it is continuous at $a$ for every real number $a$.
So the functions that are continuous everywhere are precisely the functions whose limits can be computed by simply "plugging in" (evaluating), thanks to part 3 of the definition. Among the functions that are continuous everywhere are the constants and the polynomials (like $g(x) = x+2$ above). However, to prove that such functions are continuous and that you can evaluate their limits by simply plugging in, you must use the properties of limits mentioned above, which therefore cannot be established by simply "plugging in" (that would make the argument circular).