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$ .
Since $1=\left|f(x)+\cos ^{2} x-f(x)+\sin ^{2} x\right| \leqslant\left|f(x)+\cos ^{2} x\right|+\left|f(x)-\sin ^{2} x\right| \leqslant \frac{3}{4}+\frac{1}{4}=1$, and the equality holds. Therefore, $\left\{\begin{array}{l}f(x)+\cos ^{2} x=\frac{3}{4}, \\ f(x)-\sin ^{2} x=-\frac{1}{4}\end{array} \Rightarrow f(x)=\frac{3}{4}-\cos ^{2} x\right.$.