Example 6 Given a quadratic function $f(x)$ satisfies: (1) $f(-1)=0$; (2) $x \leqslant f(x)$ $\leqslant \frac{x^{2}+1}{2}$, and $x \in R$. Find the analytical expression of this quadratic function.
Solution: Let $f(x)=a x^{2}+b x+c$. Since $f(-1)=0$, we have $a-b+c=0$. Also, $1 \leqslant f(1) \leqslant \frac{1+1}{2}$, which gives $f(1)=1$, so $a+b+c=1$.
Thus, $a+c=b=\frac{1}{2}$.
Furthermore, since $f(x) \geqslant x$, i.e., $a x^{2}+b x+c \geqslant x$, we have $a x^{2}+(b-1) x+c \geqslant 0$. For $x \in \mathrm{R}$, this implies $\Delta \leqslant 0$ and $a>0$, i.e., $a c \geqslant \frac{1}{16}$. Therefore, $c>0$.
From $\left\{\begin{array}{l}a+c=\frac{1}{2} \\ a c \geqslant \frac{1}{16}\end{array}\right.$ and $a+c \geqslant 2 \sqrt{a c} \geqslant \frac{1}{2}$, we get $a=c=\frac{1}{4}$.
Hence, $f(x)=\frac{1}{4} x^{2}+\frac{1}{2} x+\frac{1}{4}$.