Hint $ $ When debugging proofs on abstract objects, the error may become simpler to spot after specializing to more concrete objects. In your proof the symbols $\rm\:x,y\:$ denote abstract numbers, so let's specialize them to concrete numbers, e.g. $\rm\:x = y = 3.\:$ This yields the following "proof"
$$\begin{eqnarray}
3^2 &=& 3\cdot3 \\
3^2 - 3^2 &=& 3\cdot 3 - 3^2 \\
(\color{c00}{3 + 3})\:(\color{c00}{\color{#0a0}{3 - 3}}) &=& \color{c00}3\: (\color{#0a0}{3-3}) \\
\color{#c00}{3 + 3} &=&\color{#c00} 3\ \ {\rm via\ cancel}\ \ \color{#0a0}{3-3} \\
2\cdot 3 &=& 3 \\
2 &\:=\:& 1
\end{eqnarray}$$
We can find the first false inference by finding the first $\rm\color{#c00}{false\ equation}$ above; if it is equation number $\rm\: n\!+\!1,\:$ then the inference from equation $\rm\:n\:$ to $\rm\:n\!+\!1\:$ must be incorrect. Doing this above we infer that the culprit is "${\rm via\ cancel}\ \ \color{#0a0}{3-3}$", $ $ i.e. $\,x\cdot \color{#0a0}0 = y\cdot \color{#0a0}0\not\Rightarrow x = y,\,$ i.e. it divided by $\color{#0a0}0$.
Analogous methods prove helpful generally: when studying abstract objects and something is not clear, look at concrete specializations to gain further insight on the general case.
Remark $ $ It is however valid to cancel nonzero polynomials and then deduce consequences, e.g. if $\,f(x,y)\,$ and $\,g(x,y)\,$ are (formal) polynomials then
$$\begin{align}f(x,y)(x-y) &= g(x,y)(x-y)\\[.2em] \Rightarrow\ \ f(x,y) &= g(x,y)\end{align}\qquad$$
therefore $\,f(a,b) = g(a,b)$ for all $a,b\,$ (even if $\,a=b\,$ so $\,x-y = a-b = 0).\,$ For example see here where the polynomial $f$ is a determinant, and we prove Sylvester's Determinant Identity $\rm\ det\:\! (I+AB)=det\:\!(I+BA)\, $ by cancelling $\rm\,det\,A\, $ from $\rm\,det\,$ of $\rm\ (1+AB)A = A(1+B A)$. Beware that this slick proof is often wrongly deemed incorrect even by some professors - see the discussion there.