Why can we change a limit's function/expression and claim that the limits are identical? Say you have limit as $x$ approaches $0$ of $x$. You could just write it as $\frac{1}{\frac{1}{x}}$ and then the expression would be undefined. So what are you really doing when you "rearrange" an expression or function so its limit "works", and doesn't have any division by zero? Why can we suddenly change one expression to another, when they are not exactly the same, and say the limit is the same? For example, the expression $x$ is not equal to the expression $\frac{1}{\frac{1}{x}}$ because the latter is not valid for $x=0.$

When we are computing limits like $x\rightarrow a$, the value of the function at $x=a$ is irrelevant.
This means that if we are evaluating $\lim_{x\rightarrow a} f(x)$, and we know of a second function $g(x)$ which is equal to $f(x)$ everywhere except at $x=a$, then we can make the substitution
$$\lim_{x\rightarrow a} f(x) = \lim_{x\rightarrow a}g(x).$$
The reasoning is that $f$ and $g$ agree everywhere except at $x=a$, and limits don't depend on the value of the function at the limit point, so therefore the two limit values must be identical.

This principle is what allows us to transform, for example,

$$\lim_{x\rightarrow 0}\frac{x^2 +2x}{x} \Rightarrow  \lim_{x\rightarrow 0}(x+2) = 2$$
where here $f(x)\equiv \frac{x^2+2x}{x}$ and $g(x) \equiv x+2$ are two functions that have exactly the same values everywhere except at the irrelevant location $x=0$.
