This is a good question! The general result underlying this argument is roughly: "two functions which are 'almost always' equal have the same limits everywhere." The idea, then, is that the simplification $g$ of the "bad" function $f$ agrees with $f$ at every point except the small (= finite) number of bad points where $f$ is undefined, so we can switch from $f$ to $g$.
This general result is often left unstated. However, I think that even though it's a bit abstract, it will ultimately help to get it out in the open (you can always ignore it for now and come back to it later of course), so below I've given a precise formulation of it.
The precise statement of the general result given above is the following:
Given two functions $f,g$, consider the set $$Disagree:=\{x: f(x)\not=g(x)\}$$ (where I use "$\not=$" in the broad sense: if $f(a)$ is undefined and $g(a)$ is defined, then $a\in Disagree$). Suppose this set consists only of isolated points (that is, whenever $f(a)\not=g(a)$ there is some $\delta>0$ such that for all $x\in (a-\delta, a+\delta)$ other than $x=a$ we have $f(x)=g(x)$).
Then for every $c$ we have $$\lim_{x\rightarrow c}f(x)=\lim_{x\rightarrow c}g(x)$$ (that is, either both sides are undefined or both sides are defined and have the same value).
Crucially, every finite set consists only of isolated points; this is a good exercise. Consequently we have in particular:
Suppose $f, g$ are functions such that for all but finitely many numbers $x$ we have $f(x)=g(x)$. Then for every $c$ we have $\lim_{x\rightarrow c}f(x)=\lim_{x\rightarrow c}g(x)$.
If you're familiar with $\epsilon$-$\delta$ arguments, these claims are good exercises (start with the second one since it's easier to think about). Going back to your OP, the point is that switching from the original bad function $f$ to its "simplification" $g$ we only introduce one point of disagreement (namely $x=1$), so by the principle above $f$ and $g$ have the same limits everywhere even though they are different functions.