$[\cos x+\sin x]=[\cos x]+[\sin x]$,where [.] is the greatest integer function. Solve the equation in interval $[0,\pi]:[\cos x+\sin x]=[\cos x]+[\sin x]$,where [.] is the greatest integer function.
How should i start this question,breaking it into intervals is difficult.Please guide me.

Clearly the equality holds true if one of $\sin x,\cos x=0$
This $\implies x=0,\dfrac\pi2,\pi$
$[\sin x]=\begin{cases} 1 &\mbox{if } x=\dfrac\pi2 \\
0 &  \text{otherwise}  \end{cases} $ 
$[\cos x]=\begin{cases} 1 &\mbox{if } x=0 \\
0 & \mbox{if } 0<x<\dfrac\pi2\\
 -1 & \mbox{if } \dfrac\pi2<x\le\pi\\
 \end{cases} $ 
For $0<x<\dfrac\pi2,[\cos x+\sin x]=0\implies0\le\cos x+\sin x<1$
But $\cos x+\sin x=\sqrt2\sin\left(\dfrac\pi4+x\right)$
$\implies0\le\sin\left(\dfrac\pi4+x\right)<\dfrac1{\sqrt2}$
In $0\le x\le\pi$ we need $\dfrac\pi2<x\le\dfrac{3\pi}4$
For $\dfrac\pi2<x<\pi,[\cos x+\sin x]=-1\implies-1\le\cos x+\sin x<0$
$\implies-\dfrac1{\sqrt2}\le\sin\left(\dfrac\pi4+x\right)<0$
In $0\le x\le\pi$ we need $\dfrac{3\pi}4<x\le\pi$
