Sketch the graph of the following function and use it to
determine the values of $a$ for which $\lim _{x \rightarrow a} f(x)$ exists:
$f(x)=\left\{\begin{array}{ll}{1+\sin x} & {\text { if } x<0} \\ {\cos x} & {\text { if } 0 \leq x \leqslant \pi} \\ {\sin x} & {\text { if } x>\pi}\end{array}\right.$