Question: I have been trying to solve $\sin x - \cos x = 1$ by squaring both sides but has not been able to obtain the solution. Here is what I did:

$$\begin{align}(\sin x - \cos x)^2 &=1^2\\\sin^2x-2\sin x\cos x+\cos^2x&=1\\1-\sin 2x&=1\\\sin2x&=0\end{align}$$

Obviously $x=0$ is not a solution. May I ask why this is the case or where did things go wrong?

Thank You

Answer: 
You can not use squaring because $a=b$ is not equal to $a^2=b^2$.

After squaring you obtain also solutions of the following equations.
$$\sin{x}-\cos{x}=-1,$$ which we don't want. 

I think it's better the following way.
 $$2\sin\frac{x}{2}\cos\frac{x}{2}-2\cos^2\frac{x}{2}=0$$ or
$$\cos\frac{x}{2}(\sin\frac{x}{2}-\cos\frac{x}{2})=0,$$ which gives
$x=\pi+2\pi k$, $k\in\mathbb Z$ or $$\tan\frac{x}{2}=1,$$ which gives
$x=\frac{\pi}{2}+2\pi k$.
Let $a:= \sin x -\cos x;$ $ b=1;$

You have $a = b.$

Squaring: $a^2 =b^2$ gives 

$(a-b)(a+b)=0. $

You find solutions for the squared equation:

$a=b$, or $a = -b.$

Need to be a bit careful:

$\sin 2x =0;$ or $x=0;$ implies:

1) $x = 2πk$, $k$ integer.

These are the solutions for $a = -b.$, I.e.

$\sin x - \cos x = -1$.

The solution to the original problem,

$\sin x - \cos x= +1:$

2) $2x = π$ ; or $x = π/2; $ or

$x = π/2 + 2πk.$