6. Given positive integers $m, n$ satisfying $m+n=19$. Then the maximum number of solutions to the equation $\cos m x=\cos n x$ in the interval $[0, \pi]$ is
6.18.

Since $m+n=19$ is odd, then $m \neq n$. Without loss of generality, assume $m>n$.
The solutions to the equation $\cos m x=\cos n x$ are
$x=\frac{2 k_{1} \pi}{m+n}, x=\frac{2 k_{2} \pi}{m-n}\left(k_{1}, k_{2} \in \mathbb{Z}\right)$.
From $0 \leqslant \frac{2 k_{1} \pi}{m+n} \leqslant \pi, 0 \leqslant \frac{2 k_{2} \pi}{m-n} \leqslant \pi$, we get
$k_{1}=0,1,2, \cdots, \frac{m+n-1}{2}$,
$k_{2}=0,1,2, \cdots, \frac{m-n-1}{2}$.
Therefore, the number of roots of the equation is no more than
$$
\left(\frac{m+n-1}{2}+1\right)+\left(\frac{m-n-1}{2}+1\right)=m+1 \text {. }
$$

Since $n \geqslant 1$, then $m \leqslant 18$, so the number of roots is no more than 19.
However, there cannot be 19 roots, because this would include the root when $k_{1}=k_{2}=0$, thus the number of roots is no more than 18.

Next, we prove that the number of roots of the equation is exactly 18. For this, we only need to prove that when $k_{1}, k_{2}$ are not equal to 0, $\frac{2 k_{1} \pi}{m+n} \neq \frac{2 k_{2} \pi}{m-n}$. If not, then $\frac{k_{1}}{19}=\frac{k_{2}}{m-n}$, i.e., $19 k_{2}=(m-n) k_{1}$, thus $k_{1}$ is a multiple of 19. But $k_{1} \leqslant \frac{m+n}{2}=\frac{19}{2}$, so this is impossible.