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: 
Use the property that $$\sin(x-y)=\sin x\cos y-\cos x\sin y$$

We can rewrite the left side of the equation....

$$\begin{align}\sin x-\cos x&=1\\\sqrt 2\left(\sin x\cos\dfrac\pi4-\cos x\sin\dfrac\pi4\right)&=1\\\sin\left(x-\dfrac\pi4\right)&=\dfrac1{\sqrt2}\\x-\dfrac\pi4&=\dfrac\pi4+2k\pi,\pi-\dfrac\pi4+2k\pi\\x&=\boxed{\dfrac\pi2+2k\pi,(2k+1)\pi}\end{align}$$

Don't square both sides, it creates **extraneous solutions**

If you want, you can also use this property to start the solution....

$$\begin{align}a\cos x+b\sin x&\equiv R\cos(x-\alpha)\\\text{where }R=\sqrt{a^2+b^2},&\qquad\alpha=\tan^{-1}\left(\dfrac ba\right)\end{align}$$
I hope you know the expansion$$\sin(\theta+\varphi)=\sin\theta\cos\varphi+\sin\varphi\cos\theta$$Because we can use it in the equation and greatly simplify the algebra needed. Rewriting your equation$$\sin x-\cos x=1\quad\implies\quad\sqrt2\left(\frac {\sin x}{\sqrt2}-\frac {\cos x}{\sqrt2}\right)=1$$The expression inside the parenthesis can be rewritten as$$\sin x\cos\frac {\pi}4-\cos x\sin\frac {\pi}4=\sin\left(x-\frac {\pi}4\right)$$Hence$$\sqrt2\sin\left(x-\frac {\pi}4\right)=1$$Can you take it from here?