Functional Equation Problem Solving Substitution In the question below we are asked to find functions satisfying the functional equation for all $x,y \in \mathbb{R}$.
But when we substitute $x=-y$, the variable $y$ becomes dependent of $x$.
Now the solution that is given is not for all pairs of $(x,y)$ but only for pairs $(x,-x)$. 
And at the end it is written that this is the only solution.
My question is how can we substitute $x=-y$ when they are independent? and if we do that then how is this the only possible solution? 

 A: Since pairs $(x, -x)$ is a subset of the set of all pairs $(x, y)$, substituting $(x, -x)$ satisfies the conditions of the functional equation. We are trying to find a small number of plausible solutions that the expression implies.
So far, this verifies that $f(x)=0$ is the only viable solution. If you want to verify, you can substitute it into the original equation to check if the original equation holds. This is required to obtain a complete analysis of this functional equation.
If the original equation does not hold with the plausible solutions, you can conclude that no solutions exist. Otherwise, you know that that is the only solution.
A: We have a function $f$ that has the condition that for all real numbers $x,y$:
$$
f(x+y) = f(x)^2 + f(y)^2
$$
The symbols $x$ and $y$ are used here to express the condition we have for the function $f$. They do not mean anything else.

This condition should be valid when the two numbers are for example $t$ and $-t$ for some real number $t$. So we know that for all real numbers $t$, 
$$
f(t+(-t)) = f(t)^2 + f(-t)^2.
$$
But as I said, the symbols $x$ and $y$ that were used when expressing the condition for $f$ do not have any meaning. We might as well replace the symbol $t$ with the symbol $x$ in the previous paragraph and say that for all real numbers $x$,
$$
f(x+(-x)) = f(x)^2 + f(-x)^2.
$$
Saying "Let $x=-y$" is just a way of saying that $x$ here corresponds to the $x$ used in the original expression and $-x$ corresponds to the $y$ in the original expression.
