6. Let $f(x)$ be a function defined on $\mathbf{R}$, satisfying
$$
\left|f(x)+\cos ^{2} x\right| \leqslant \frac{3}{4},\left|f(x)-\sin ^{2} x\right| \leqslant \frac{1}{4} .
$$

Then the analytical expression of the function $f(x)$ is . $\qquad$
2,6. $f(x)=\sin ^{2} x-\frac{1}{4}$.
From the given and
$$
\begin{array}{l}
1=\sin ^{2} x+\cos ^{2} x \\
\leqslant\left|f(x)+\cos ^{2} x\right|+\left|f(x)-\sin ^{2} x\right| \\
\leqslant \frac{3}{4}+\frac{1}{4}=1,
\end{array}
$$

we get $\left|f(x)+\cos ^{2} x\right|=\frac{3}{4},\left|f(x)-\sin ^{2} x\right|=\frac{1}{4}$.
Thus, $f(x)=\sin ^{2} x-\frac{1}{4}$.