How is substituting $-y$ for $y$ with $y \neq 0$ legal? I'm currently going through Spivak's Calculus, and I got across the following problem:
Prove that $x^3+y^3=(x+y)(x^2-xy+y^2)$.
To prove it, the author wants to use another problem that was proved earlier, i.e $x^3-y^3 = (x-y)(x^2+xy+y^2)$
The solution says to simply replace $y$ with $-y$ in the above equation. But $y$ can't be equal to $-y$ as long as $y \neq 0$, so how is this a legal operation?
 A: Ant's answer is correct, but here's another way of saying the same thing, with a telling example. 
Spivak's operation is in fact "legal," as you say, because it is just an instance of what a logician would call the "law of substitution." 
As another example, presumably you know how a difference of squares factors: 
$$x^2-y^2=(x-y)(x+y)$$
But this identity holds for all real numbers $x$ and $y$;
$x$ and $y$ can stand for whatever real number you want. So we should really think of this equation as shorthand for infinitely many different factorizations, each given by substituting a different value for $x$ and $y$. For example, substituting $x=a+b$ and $y=c+d+e$ gives the seemingly more difficult result
$$(a+b)^2-(c+d+e)^2=(a+b-c-d-e)(a+b+c+d+e)$$
But really this equation follows from the first by the substitution principle. That's exactly the sort of argument Spivak is giving here.
A: The author is saying: $y$ is not a particular number, that equation holds for every real number. So it works for $y=3$ but also for $y = -3$ or $y = \pi$ or whatever. 
So you can "substitute" $-y$ instead of $y$ because, even if the two numbers are different, the relation still holds
Another way of doing it would be: call $y = -z$. Look at the result you get.
Clearly now you'll find a relation in $z$ and not in $y$. But since $z$ and $y$ are only names, you can always call $z = y$ to get the "correct" result. What we did was essentially substituting $y = -y$ but maybe now it's a little bit more clear
A: What substituting $y=-y$ essentially means as follows:
$x^3 + y^3$ = $x^3 -(-y)^3$
Hence $x^3 + y^3$ = $(x - (-y))(x^2 + x(-y) + y^2)$ 
= $(x+y)(x^2 -xy +x^2)$
Well it's as simple as that. Basically you just input any arbitrary negative number and you get this result. Hope this helped explain the intuition behind the substitution.
