24. $\operatorname{ctg} x-\operatorname{tg} x=\sin x+\cos x$.

24. $\cot x - \tan x = \sin x + \cos x$.
24. Expressing $\operatorname{tg} x$ and $\operatorname{ctg} x$ in terms of $\sin x$ and $\cos x$, we reduce the equation to the following form: $(\sin x+\cos x)(\cos x-\sin x-\sin x \cos x)=0$.

If $\sin x+\cos x=0$, then $\operatorname{tg} x=-1$, from which $x_{1}=-\frac{\pi}{4}+\pi k$.

If $\cos x-\sin x-\sin x \cos x=0$, then, multiplying the terms of this equation by 2 and adding the identity $\sin ^{2} x+\cos ^{2} x=1$, we get $(\cos x-\sin x)^{2}+2(\cos x-\sin x)-$ $-1=0$, from which $\cos x-\sin x=\sqrt{2}-1$. The second root is extraneous.

$$
\begin{aligned}
& \cos \frac{\pi}{4} \cos x-\sin \frac{\pi}{4} \sin x=\frac{\sqrt{2}-1}{\sqrt{2}} ; \cos \left(\frac{\pi}{4}+x\right)=\frac{\sqrt{2}-1}{\sqrt{2}} \\
x= & 2 \pi k-\frac{\pi}{4} \pm \arccos \frac{\sqrt{2}-1}{\sqrt{2}} ; x=\frac{\pi}{4}(8 k-1) \pm \arccos \frac{\sqrt{2}-1}{\sqrt{2}}
\end{aligned}
$$