Why is "division by $(z-1)$" valid here? 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$.
 A: This is a consequence of the fact that a nonzero polynomial whose coefficients are complex numbers (or in any integral domain) has no more roots than its degree. This quickly yields what we seek, viz.
Theorem $ $ If $\,f,g,h\,$ are polynomials with coefficients in $\Bbb C$ (or any infinite field C) and $\,f\neq 0\,$ then
$$\begin{align} f(x) g(x) &= f(x) h(x)\ \ \text{for all }\, x\in C\\  
\Rightarrow\ \  g(x) &=  h(x)\qquad\ \ \text{for all }\, x\in C\end{align}$$
Proof $\ $ Since $\,f\neq 0\,$ it has only finitely many roots (at most $\deg f).\,$ Thus there are infinitely many nonroots $\,c\in C\,$ where $\,0\neq f(c)\,$ so it is cancellable, thus
$$f(c)\,(g(c)-h(c)) = 0\,\Rightarrow\, g(c)-h(c) = 0$$ 
Thus the polynomial $\,g(x)-h(x)\,$ has infinitely many roots $\,x = c\,$  so it is identically zero. 
Remark $ $ It fails for finite fields, e.g. over $\,\Bbb Z_3 = $ integers $\!\bmod 3\,$ we have $ x(x^2) = x(1)\,$ for all $\,x,\,$ but $\, x^2 = 1\,$ is false at $\,x = 0$.
A: 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$.
A: You can first note that the implication is true for $x=0$ by checking it.  Then you can say you still have to prove it for $x\neq 0$, but then you can divide by $x$.
A: Here's a way we could go about it, using proof by contrapositive.
Suppose that there is some $x\in\Bbb C$ such that $$(x-1)(x+1)\neq x^2-1.$$ Noting that $$(0-1)(0+1)=(-1)(1)=-1=0-1=0^2-1,$$ we must have $x\ne 0.$ Thus, since $(x-1)(x+1)\neq x^2-1,$ then we have $$x(x-1)(x+1)\neq x\left(x^2-1\right).$$

Added: Bearing in mind that, for any statements $p$ and $q,$ we have that $p\implies q$ is equivalent to $(\neg p)\vee q,$ the "implication" is true trivially, merely because $(x-1)(x+1)\equiv x^2-1$ is true. By the same token, $$1\neq 1\implies(x-1)(x+1)\equiv x^2-1.$$ Clearly, no division by $0$ takes place in this implication, yes?
A: You're not dividing by 0 though. 
You're saying $x(x-1)(x+1)=x(x^2-1)$ implies $(x-1)(x+1)=x^2-1$ for any $x \in \mathbb{R}$. That is a true statement. I understand where your confusion is coming from. You're dividing both sides by $x$, and since $x \in \mathbb{R}$, then $x=0$ at some point. Think of the statement "$x(x-1)(x+1)=x(x^2-1)$ implies $(x-1)(x+1)=x^2-1$" as taking a sort of "leap of logic". It's true, even if $x=0$, the statement is true. Now what happens when $x=0$ and you have the equation $x(x-1)(x+1)=x(x^2-1)$? You can't divide both sides by $x$ anymore. However, this does not imply that $(x-1)(x+1)=x^2-1$ is false, it just means you can't logically jump from $x(x-1)(x+1)=x(x^2-1)$ to $(x-1)(x+1)=x^2-1$ when $x=0$.
