Addendum added to respond to the comment/question of lopan.
The book apparently left out some details.
$(x + y) = 0 \iff x = -y$.
Therefore, you can assume, without loss of generality, that $(x + y) \neq 0$, and then explore what happens, based on this assumption.
From the constraints, you have that
$$(x+y)^3 - (xy)(x+y) = 0. \tag1 $$
Since it is being assumed that $(x+y) \neq 0$, you can divide both sides of (1) above by $(x+y)$.
This yields:
$$(x+y)^2 - xy = 0 \implies x^2 + xy + y^2 = 0. \tag2 $$
There are a number of semi-sophisticated ways to proceed from here. The least sophisticated (i.e. simplest) is to construe the equation in (2) above as a quadratic equation in $x$.
Then
$$x = \frac{1}{2} \left[-y \pm \sqrt{y^2 - 4y^2}\right]$$
$$= \frac{1}{2} \left[-y \pm \sqrt{-3y^2}\right]. \tag3 $$
The only way that $x$ can be set to a real value is if the expression $(-3y^2)$ is non-negative.
This requires that $y = 0$ which then implies that $x = 0.$
Addendum
Responding to the comment question of lopan:
But I don't see how the whole thing starts, why is the question about when $(x+y)=0$ and not about when the original equation is zero?
Let $f(x,y) = x^3+2x^2y+2xy^2+y^3.$
The original problem is to find all (presumably real numbers) $(x,y)$ such that $f(x,y) = 0.$
As you indicated at the start of your analyis,
$$f(x,y) = (x + y)^3 - (x+y)(xy).$$
Therefore, the original problem can be re-stated as:
$$(x+y) \times \left[(x+y)^2 - xy\right] = 0. \tag3 $$
Therefore, if $(x + y) \neq 0$ then you must have that
$$(x+y)^2 - xy = 0.$$