Let \(f(x)=\left\{\begin{array}{cl}-2 \sin x, & \text { if } x \leq-\frac{\pi}{2} \\ A \sin x+B, & \text { if }-\frac{\pi}{2}<x<\frac{\pi}{2} . \text { Then } \\ \cos x, & \text { if } x \geq \frac{\pi}{2}\end{array}\right.\)
(A) \(f\) is discontinuous for all \(A\) and \(B\)
(B) \(f\) is continuous for all \(A=-1\) and \(B=1\)
(C) \(f\) is continuous for all \(A=1\) and \(B=-1\)
(D) \(f\) is continuous for all real values of \(A, B\)