Is $x/x$ equal to $1$
The function $f(x) = \frac{x}{x}$ is defined for all $x \in \mathbb{R}\setminus\{0\}$. Its limits exist from the left and from the right at $0$, but it is not defined at $0$. It doesn't matter if you "simplify" first and then "check" or the other way around, because as you pointed out you're not allowed to divide by $0$. Thus $$f(x) = \begin{cases} 1 & x \neq 0 \\ \text{undefined} & x = 0\end{cases}.$$ Consider the same question, $$g(x) = \frac{x^2 - 2x + 1}{x-1}.$$ What is this function?
For any real number $x\neq0$, $$x=x,$$$$\Leftrightarrow$$$$\dfrac{x}{x}=1.$$ $x=0$ $\Rightarrow x=x,$ but now we cannot divide by $x$. (Why?)
In fact, this is an indeterminate form.
Suppose that, $\dfrac{0}{0}=\color{red}{1}$. Hence, $0=\color{red}{1}\cdot0$.
Therefore, $\color{red}{2}\cdot0=\color{red}{1}\cdot0$ since $\color{red}{2}\cdot0=0$.
So, $\color{red}{\dfrac{2}{1}}=\dfrac{0}{0}$.
Thus $\color{red}{2}=1.$