6. Given $\sin (x+\sin x)=\cos (x-\cos x)$, where $x \in[0, \pi]$. Then $x=$
6. $\frac{\pi}{4}$.

The original equation is equivalent to
$$
\cos \left(\frac{\pi}{2}-x-\sin x\right)=\cos (x-\cos x) .
$$

Thus,
$$
x-\cos x=2 k \pi+\frac{\pi}{2}-x-\sin x \quad(k \in \mathbf{Z}),
$$

or
$$
x-\cos x=2 k \pi-\left(\frac{\pi}{2}-x-\sin x\right) \quad(k \in \mathbf{Z}) .
$$

From equation (1), we get
$$
2 x+\sin x-\cos x=2 k \pi+\frac{\pi}{2},
$$

and the function $f(x)=2 x+\sin x-\cos x$ is increasing on $[0, \pi]$. Therefore,
$$
-1<\frac{\pi}{4}$, $g(x)>0$; when $x<\frac{\pi}{4}$, $g(x)<0$. Therefore, $g(x)=0$ if and only if $x=\frac{\pi}{4}$.
From equation (2), we get
$$
\sin x+\cos x=\frac{\pi}{2}-2 k \pi
$$

Since $1<\frac{\pi}{2}-2 k \pi<\sqrt{2}$, there is no integer solution for $k$, meaning this equation has no solution.
In conclusion, the solution to the original equation is $x=\frac{\pi}{4}$.