Đáp án: $B$
Giải thích các bước giải:
Ta có $\sin\dfrac{\pi}{4}=\cos\dfrac{\pi}{4}=\dfrac{1}{\sqrt2}$
$y=\sin x-\cos x$
$=\sqrt2.\left( \dfrac{1}{\sqrt2}\sin x-\dfrac{1}{\sqrt2}\cos x\right)$
$=\sqrt2.\sin\left(x-\dfrac{\pi}{4}\right)$
Ta có $\sin\alpha\in[-1;1]\quad\forall \alpha$
$\to y\in [-\sqrt2;\sqrt2]$
Vậy $\min y=-\sqrt2; \max y=\sqrt2$