There are many examples in math where you have fake proofs of something because you do something extraneous that you were not allowed to do. For example:
Let $$1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \dots = \log 2,$$ but $$1 + \frac{1}{3} - \frac{1}{2} + \frac{1}{5} + \frac{1}{5} + \dots = \frac{3}{2}\log 2$$ (rearranging the series). In elementary calculus, we are taught that we cannot rearrange series precisely for this reason: We may change the value that the series equals. Another example would be the equation
$$\large{x^{x^{x^{x^{\dots}}}}} = 2.$$ Then we use the property that it repeats to see that $x^2 = 2,$ which implies that $x = \sqrt{2}$ for positive $x$. But then, if we wish to solve $$\large{x^{x^{x^{x^{\dots}}}}} = 4,$$ then using the same trick we see that $$x^4 = 4 \implies \sqrt[4]{x^4} = \sqrt[4]{4} \implies x = \sqrt{2}.$$ Once again, we did something we are not allowed to do.
My question is therefore: how do we know that we aren't doing something illegal when exploring mathematics? When we try to solve problems, or discover patterns or learn, how can we tell when we do something extraneous?
By knowing very well the rules of the game i.e. 1) the definitions, 2) the axioms, and 3) the theorems within a given math theory. A tiny change, or addition, or even misinterpretation of any of these... and a slip may happen leading to various paradoxes, false proofs, etc.
Math is not about syntactic, mechanical manipulation of mysterious symbols; there's deep meaning behind every symbol. Make sure you know the meaning of the symbol, only then use it.
E.g. when I see this
$\large{x^{x^{x^{x^{\dots}}}}}$
it is not immediately clear to me what it means.
So I would exercise extra care if I have to manipulate this expression.