Is my understanding of limits correct? I want to explain the basic concept of limits to see if my understanding is correct or not.
If we have a function in the form of a fraction and for a value of $x$ the numerator and denominator $=0$ ,  the graph of the function will have a perforation. In order to find the coördinates of the perforation we can use limits to rewrite the function in a form so that we can put in the value of $x$ that would have resulted in $0$.
Because of the limits we can rewrite, for example, $f(x)= \frac {x^2 - 5x + 6}{x-2}$ = $\frac {(x-3)(x-2)}{x-2}$ to $\displaystyle \lim_{x \to 2} x-3 = -1$
We normally are not allowed to divide by $x-2$ because we do not know if $x-2$ could equal $0$. In this case we know $x=2$ will result in $0$, so the limit basically says that we take a $x$ that is very close to $2$, like $1.9999999999999$ but does not equal $2$ and therefore we can divide by $x-2$ and simplify the function to a form where we can input $x=2$
Please correct me if I am wrong and apologies for some of the formatting, I do not know how to format the limit correctly.
 A: Too long for a comment.
The meaning of a limit is literally in the name: the limit. It's the value a function approaches as the input approaches a certain value $a$. Notice the word "approaches." Meaning neither does the input, nor the function actually reach the point of interest at $x=a$. The limit is the value that's strictly surrounded by the function values as you approach $a$; you never get there, that's why it's called the limit. Keep in mind that the limit doesn't have to be a possible output of the function.
Limits are not only interesting when the function is not defined at $a$; we can also use them to check a function is continuous (i.e is connected with no cuts) by checking the limit is the same as the value of the function at $a$. Continuous functions admit very nice theorems and are easier to work with in general.
That's why you can cancel the factors that cause problems when taking the limit; you are essentially removing the discontinuity, i.e replacing the function with a continuous one, both should approach the same value as you approach $a$ because they only differ in the definition at $a$ which we don't use anyway to evaluate the limit.
Make sure you think about this a lot to solidify your intuition of why and how limits work.
A: Yeah, you're just about right. It's a shame that limits are introduced in high school without ever truly defining what they are. Maybe this helps a bit: One usually starts with sequences, not functions: Let $(x_n)_{n\in\mathbb{N}}\subset\mathbb{R}$ be real sequence, i.e. $x_1,x_2,x_3,...\in\mathbb{R}$.
Then, one says that this sequence has $x'\in\mathbb{R}$ as its limit, and writes $\lim\limits_{n\rightarrow\infty} x_n = x',$ if the quantity $|x'-x_n|$ becomes arbitrarily small for big $n\in\mathbb{N}$, which is usually defined as follows: $$\lim\limits_{n\rightarrow\infty} x_n = x'\Longleftrightarrow\text{ for all  } \varepsilon>0 \text{ there exists a $N\in\mathbb{N}$ with } |x'-x_n|<\varepsilon \text{ for all $n\geq N$.}$$
Now, what about functions $f:\mathbb{R}\rightarrow\mathbb{R}$? Take any $x'\in\mathbb{R}$, then there are a lot of ways to reach this point as the limit of a sequence. E.g. $x'=0$ is the limit of the sequences $(\frac{1}{n})_{n\in\mathbb{N}}$, $\left(\frac{(-1)^n}{n^2}\right)_{n\in\mathbb{N}}$, etc.
If there exists a $y\in\mathbb{R}$, so that $\lim\limits_{n\rightarrow\infty} f(x_n)=y$ for all possible sequences $(x_n)_{n\in\mathbb{N}}$ with $\lim\limits_{n\rightarrow\infty} x_n = x'$, then one writes $$\lim\limits_{x\rightarrow x'} f(x) = y.$$
Concretely, the expression $\lim\limits_{x\rightarrow 2} f(x) = -1$ from your original post means that the limit of $(f(x_n))_{n\in\mathbb{N}}$ is $-1$ for every possible sequence $(x_n)_{n\in\mathbb{N}}$ that converges towards $2$.
In theory, this would also allow the sequence $x_n = 2$ for all $n\in\mathbb{N}$, which would yield a division by zero in your function. That's why a priori (before computing the limit), your function is only defined on $I=\mathbb{R}\setminus\{2\}$. Thus, every possible sequence in $I$ that converges towards $2$ never takes $2$ as its value, and so you can divide by $(x-2)$ without running into problems.
