Let $p,q$ be integers. If $p=q$, one has nothing to do. Suppose $p<q$. Let
$$F(x)=\dfrac1p(\sin^px+\cos^px)-\dfrac1q(\sin^qx+\cos^qx)$$
and then
\begin{eqnarray}
F'(x)&=&\sin^{p-1}x\cos x-\cos^{p-1}x\sin x-\sin^{q-1}x\cos x+\cos^{q-1}x\sin x\\
&=&\sin x\cos x(\sin^{p-2}x-\cos^{p-1}x-\sin^{q-2}x-\cos^{q-1}x).
\end{eqnarray}
If $f(x)-g(x)$ is constant, then $F'(x)\equiv0$ and hence
$$ \sin^{p-2}x-\cos^{p-1}x-\sin^{q-2}x-\cos^{q-1}x\equiv0.$$
Let
$$ h(x)=\sin^{p-2}x-\cos^{p-1}x-\sin^{q-2}x-\cos^{q-1}x $$
and then
\begin{eqnarray}
h'(x)&=&(p-2)\sin^{p-3}x\cos x+(p-2)\cos^{p-3}x\sin x-(q-2)\sin^{q-3}x\cos x-(q-2)\cos^{q-3}x\sin x\\
&=&\sin x\cos x\big\{(p-2)\big[\sin^{p-4}x+\cos^{p-4}x\big]-(q-2)\big[\sin^{q-4}x+\cos^{q-4}x\big]\big].
\end{eqnarray}
Since $h(x)\equiv0$, $h'(x)\equiv0$. Clearly if $p=2$, then $q=2$. Suppose $p>2$. Let $x=\frac{\pi}{4}$ and then one has
$$ (\frac{\sqrt{2}}{2})^{p}=\frac{q-2}{p-2}(\frac{\sqrt{2}}{2})^{q}$$
or
$$ 2^{\frac12(q-p)}=\frac{q-2}{p-2}. $$
Let $p-2=2m,q-2=2n$ ($m<n$) and then one has
$$ 2^{n-m}=\frac{n}{m} $$
from which one has $n=m2^r$ ($r>0$). So
$$ 2^{m(2^r-1)}=2^r$$
or $$ m(2^r-1)=r. $$
Noting if $r>1$, $2^r-1>r$ and hence $m(2^r-1)>r$, one must have $r=1$ and hence $m=1,n=2$. Thus $p=4,q=6$.