Basic Algebra Help \begin{align}
x^2-2x+1 &= x^2-2x+1\\
(1-x)^2 &= (x-1)^2\\
\sqrt{(1-x)^2} &= \sqrt{(x-1)^2}\\
1-x &= x-1\\
1-x &= -1\cdot(1-x)\\
1 &= -1
\end{align}
I definitely did something wrong.
 A: $a^2 = b^2$ does not mean $a=b$. For example $1^2 = (-1)^2$ but that doesn't mean $1 = -1$. Instead, all you can conclude is that $|a| = |b|$, which means that $a=b$ or $a=-b$. 
A: \begin{align}
x^2-2x+1 &= x^2-2x+1\\
(1-x)^2 &= (x-1)^2\\
\sqrt{(1-x)^2} &= \sqrt{(x-1)^2}\\
\end{align}
OK, as square root is unambiguously defined as non-negative value.

First (very common) error is that from the last equation follows
\begin{align}
1-x &= x-1\\
\end{align}
That is not correct, as you may see from this example:
\begin{align}
4^2 &= (-4)^2\\
\end{align}
so
\begin{align}
\sqrt{4^2} &= \sqrt{(-4)^2}\\
\end{align}
in spite of
\begin{align}
4 \neq -4
\end{align}
(Remember, square root is a non-negative value, so right-hand side is incorrect.)

Second, also a common error is dividing both sides of an equation with the same number without a consideration if it is not zero:
\begin{align}
1-x &= -1\cdot(1-x)\\
1 &= -1
\end{align}
The correct method for solution of the equation
\begin{align}
1-x &= -1\cdot(1-x)\\
\end{align}
is put all members with $x$ to one side of the equal sign and others to the opposite one:
\begin{align}
-2x &= -2\\
 x &= 1\\
\end{align}
From this (single) solution you may immediately see why dividing both sides by $(1-x)$ was incorrect - we divided them by zero.
