TITLE: Why is "division by $(z-1)$" valid here?
QUESTION [6 upvotes]: 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$.

REPLY [3 votes]: For an alternative perspective, consider that the polynomials you are looking at can be thought of as purely formal objects without analytical meaning. Don't think of the polynomials as polynomial functions that you need to worry about being $0$ when you plug in different values of $x$, but as algebraic objects belonging to the ring of polynomials $\mathbb C[x]$. 
Then your problem disappears because the ring of polynomials over $\mathbb C$ is an integral domain, meaning that for $f(x),g(x)\in\mathbb C[x]$, if $f(x)g(x)=0$ (importantly: here $=$ is a polynomial equality, not an equality of complex numbers), then either $f(x)=0$ or $g(x)=0$. You can prove this property in many ways. In fact, it is true that $R[x]$ is a domain whenever $R$ is, and $R$ does not need to be a field like $\mathbb C$. One nice way is to consider the leading coefficients of two nonzero $f(x),g(x)$ in the ring of polynomials: since the leading coefficients are nonzero, then their product is nonzero (because the ring of coefficients is a domain) so the polynomial product is nonzero too.
How does this tie in with the usual concept of polynomial functions? Well, for any $\alpha\in\mathbb C$, there exists a unique homomorphism $\phi_\alpha:\mathbb C[x]\to\mathbb C$ that sends $x$ to $\alpha$, called the evaluation homomorphism. This homomorphism essentially gives you a way to "plug in" the value of $\alpha$ into a formal polynomial, recovering the idea of a function. But since we have dealt with the issue of division by zero within the ring of polynomials where division by zero is a non-issue, we are now safe, because two polynomials that are formally equal define the same function over $\mathbb C$.