I'll give an example for my first question:
$x^2 + x + 1 = 0$
Clearly $x = 0$ and $x = 1$ aren't solutions, so first we can safely divide by $x$:
$x + 1 + 1/x = 0$
By subtracting $1/x$ from both sides we get:
$x + 1 = -1/x$
By plugging the value $x + 1$ back we get:
$x^2 - 1/x = 0$
Multiplying by $x$ and adding $1$ to both sides:
$x^3 = 1$
Which $x = 1$ is clearly a solution to, unlike the original equation.
I have a problem with this, all manipulations did not include dividing by zero or any non-defined operations, all what was done is expressing $x$ by a different way so why does it change the final solution?
When we divided the equation by $x$ the solution shouldn't change which means the first equation holds so why isn't the second one compatible with the first?
On another note, I have a different question that is slightly related to this one, an example for this one is:
We have the system of equations $S$ which is:
$x + y + z = 1 \quad (L1)$
$x + y - z = 1/2 \quad (L2)$
$x - y + z = -4 \quad (L3)$
Then we transform this system into $S'$ by manipulating equations together:
$2x + 2y = 3 \quad (L1 + L2)$
$2y - 2z = 6 \quad (L2 - L3)$
$2x + 2z = -3 \quad (L1 + L3)$
The solution for $S$ (which is $(-3/2, 5/2, 0)$) also doesn't satisfy $S'$, which is counterintuitive to me because that's the kind of transformations we're taught then why does it change the solution?
For both questions are those like general phenomenons or are they just special cases? What are the names of topics concerned with the act of transforming equations like the examples above?