Is there an easy way to justify: $$x(x-1)(x+1) \equiv x(x^2-1) \Rightarrow (x-1)(x+1) \equiv x^2-1,$$ even for $x=0$? I seemingly have to divide by $x$ which should place the restriction $x \neq 0$ on the final result. Does this work only for polynomials?
EDIT: thank you for the comments, in light of the suggestions to do case work I'll update with a more involved example to demonstrate why I am not looking for this approach. I'm sorry to move the goal posts a bit, let me know if this should be a new question.
Let's suppose that $w=e^{2\pi i/n}$ where $n$ is an integer. Let's say I've deduced that $$(z-1)(z-w)(z-w^2)...(z-w^{n-1}) \equiv (z-1)(1+z+z^2+...+z^{n-1}).$$
I want to conclude here that $(z-w)(z-w^2)...(z-w^{n-1}) \equiv 1+z+z^2+...+z^{n-1}$ including $z=1$ - it's not easy to verify by cases anymore since I am actually trying to use this factorisation to show that $(1-w)(1-w^2)...(1-w^{n-1})=n$.