Why do we get extraneous roots when solving radical or rational equations? We all know that we might get extraneous solutions when solving certain equations like rational equations and equations with radicals. In high school, teachers tell students that they should always check the solutions they obtained when solving equations like these because extraneous roots might appear. I'd like to know what's the theoretical framework behind this. I read a bit on Wikipedia but I'm not quite satisfied with that. So:

a) Why do we get extraneous roots when solving radical or rational equations?
b) Under which conditions do we get extraneous roots? I mean is there a way to tell when you will extraneous roots? why?

The more technical the answers, the better. Thanks in advance!
 A: Two mathematical statements are equivalent if they represent the same "truth", or the same solution. A lot of basic algebra involves moving between equivalent statements by applying reversible transformations.
For example, the operation "add 2 to both sides of the equation" is reversible, since you can subtract 2 from both sides and get back to your original equation:
$$\begin{eqnarray} x - 3 & = & 5 & \iff \\
(x - 3) + 2 & = & 5 + 2 & \iff \\
x - 1 & = & 7 \end{eqnarray}$$
Notice that if you substitute $x = 8$ into all three rows of the above, you always get a true statement ($5 = 5$ in the first row, and $7 = 7$ in the other two). And if you substitute any other value for $x$, you get a false statement - e.g. $x = 1$ gives you $-2 = 5$ in the first row, and $0 = 7$ in the others. So the "solution set" for all three equations is the same thing.
The same goes for "multiply both sides of the equation by 2", which you can reverse by dividing by 2. These are both reversible, or we might say invertible operations.
However, not every operation is invertible. Multiplying by zero is not invertible - once you do that, you can't go back to the original value; neither is dividing by zero - doing so leads to something undefined. Squaring and taking the square root have a similar problem:
$$\begin{eqnarray} x & = & -2 & \implies \\
x^2 & = & 4 & \iff \\
x & = & \pm 2 \end{eqnarray}$$
Notice that here I used a forwards implication arrow $\implies$ rather than the bidirectional one $\iff$ in the first row because by squaring the equation I've applied a non-invertible operation, and that's why the second and third lines have an extra value in the solution set. A similar thing would happen if I applied the square root going from the second to the third equation and only took the positive root - I would discard one of the two solutions, leaving me with just one.
This can happen more subtly, too. If I take an equation and multiply it by $y - 3$, then I am expanding the solution set:
$$\begin{eqnarray} x + y & = & 5 & \implies \\
(x + y) \times (y - 3) & = & 5 \times (y - 3) & \iff \\
xy + y^2 - 3x - 3y & = & 5y - 15 & \iff \\
xy + y^2 - 3x - 8y & = & -15 \end{eqnarray}$$
The first equation admits any solution of the form $(x, y) = (t, 5 - t)$, for example $(x, y) = (1, 4)$. And those are definitely solutions of the last equation too. But notice that $(x, y) = (0, 3)$ is a solution of the last equation, but not of the first. Why? Because by multiplying by $y - 3$, we added $(x, y) = (s, 3)$ to the solution set. How did this happen? Because when $y = 3$, $y - 3 = 0$, and so we have implicitly multiplied by zero.
A lot of fallacious "1 = 2" proofs work by secretly removing a solution in a similar way - by dividing out a factor that's might be equal to zero, or by using squaring and square roots to swap something from negative to positive.
A: I would like to suggest looking at things a bit differently and arguing that there are no extraneous solutions.  There are only the correct number of solutions for a given problem.
Say we're asked to find the length of the diagonal of the unit square.  That's a number which squared equals $2$.  The only answer is $\sqrt{2}$, since lengths are always positive.
When asked to find all rational numbers whose square equals $2$, we find there are no solutions to the problem (see $\sqrt{2}$ is irrational).
If we need to find the $x$-intercepts on the graph of the curve $y=x^2-2$, we need to solve the equation $x^2=2$ in real numbers to obtain $(-\sqrt{2},0)$ and $(\sqrt{2},0)$, but there's nothing extraneous about the solution that gives the intercept $(-\sqrt{2},0)$.
One last example if we were asked to find a number between minus three and three ($-3\le x \le 3$) whose square differs from a multiple of $7$ by $2$  ($x^2=2$ again, sort of) and which differs from a multiple of $7$ by $4$, the only answer would be $-3$.
One solution, no solutions, two solutions, one solution, all connected to this same equation $x^2=2$.  The number of solutions depends on our problem, and the information we have about the solutions.
