4. The range of the function $y=\arcsin [\sin x]+\arccos [\cos x](x \in[0,2 \pi),[x]$ represents the greatest integer not exceeding the real number $x$) is $\qquad$ .
4. $\left\{0, \frac{\pi}{2}, \pi\right\}$.

When $x \in\left[0, \frac{\pi}{2}\right) \cup\left(\frac{\pi}{2}, \pi\right]$, $[\sin x]=0$; when $x=\frac{\pi}{2}$, $[\sin x]=1$; when $x \in(\pi, 2 \pi)$, $[\sin x]=-1$.

When $x=0$, $[\cos x]=1$; when $x \in\left(0, \frac{\pi}{2}\right] \cup\left(\frac{3}{2} \pi, 2 \pi\right)$, $[\cos x]=0$; when $x \in\left(\frac{\pi}{2}, \frac{3}{2} \pi\right)$, $[\cos x]=-1$.

Therefore, when $x=0$ and $x \in\left[\frac{3}{2} \pi, 2 \pi\right)$, $y=0$; when $x \in\left(0, \frac{\pi}{2}\right) \cup\left(\pi, \frac{3}{2} \pi\right)$, $y=\frac{\pi}{2}$; when $x \in\left[\frac{\pi}{2}, \pi\right]$, $y=\pi$.
Thus, the range of values is $\left\{0, \frac{\pi}{2}, \pi\right\}$.