According to my book
In the given equation $$x^2+x+1=0\tag{1}$$
If $a$ is a root of eqn $(1)$ then $a$ satisfies the following equation
$$a^2+a+1=0\tag{2}$$
$$\implies (a-1)(a^2+a+1)=0\tag{3}$$
$$a^3=1$$
How do you get the last $3$ equations? Also, how does $(3)$ follow from $(2)$? It's not the same thing mathematically.
EDIT: Okay I've got my answer, although I still have another doubt. How do we get $a^2+a+1=0$ merely because $a$ is a root of the original equation?
We say that $a$ is a root of $f(x)=x^2+x+1$ if $f(a)=a^2+a+1=0$. Hence equation $(2)$ follows form $(1)$, if we say that $a$ is a root. $(3)$ follows from $(2)$ since $0=0\cdot (a-1)=(a^2+a+1)(a-1)=a^3-1$.