The problem is substituting $x=1$ into the original equation. In the first part, we show that:
If $x$ is a root of $x^2+x+1$ then it is also a root of $x^3-1$.
Then in the second part we assert:
Since $x=1$ is a root of $x^3-1$ it must also be a root of $x^2+x+1$.
This is an example of affirming the consequent: "if P then Q; Q is true; therefore P."
As to why in the first step we only have an "if" and not an "if and only if," I think that thisIs4d's answer explains this very elegantly. Here is my own explanation of why:
The first step is an "if and only if," because the argument takes care to exclude the potentially problematic case of $x=0$, thus we have:
$$
x^2+x+1=0 \iff x+1=-\frac{1}{x}
$$
We can rearrange the original equation so that the part that is substituted is isolated on one side:
$$
-x^2=x+1 \iff x+1=-\frac{1}{x}
$$
Now at this point, we are strongly reminded of the transitive property of equality, "things that are equal to the same thing are also equal to one another." That is, if $a=b$ and $b=c$ then $a=c$. It is tempting to just "add on" the third equality to our equivalence:
$$
-x^2=x+1 \iff x+1=-\frac{1}{x} \iff -x^2=-1/x
$$
Taking the first and third terms (and doing some rearranging) would give us:
$$
x^2+x+1=0 \iff x^3-1=0
$$
Which, as we saw above, is not true. Why not? Remember that an equivalence is an "if and only if:" when one side is false, the other side must also be false. And if $a=b$ and $b=c$ are both false, we could still have $a=c$ by coincidence! Therefore we have to downgrade our equivalence to an implication, a.k.a. a plain "if."
Unlike in the classic argument that $1=2$ which involves a single 'obviously illegal' step (division by zero), there is no one wrong step in this argument. Most answers identify the final substitution (or the logical argument it implies) as "the" mistake, but it is equally as valid to recognize the first substitution as the mistake (as I think Jakub Komárek's answer does). That, I think, makes this a better example of a "bad" proof.