(I) 求实数 $a$ 的值;
(II) 求正交变换 $\boldsymbol{x}=\boldsymbol{Q} \boldsymbol{y}$ 将二次型 $f$ 化为标准形.

( I ) $\boldsymbol{A}^{\mathrm{T}} \boldsymbol{A}=\left[\begin{array}{rcc}1 & 0 & 1 \\ 0 & 1 & 1 \\ -1 & 0 & a \\ 0 & a & -1\end{array}\right]^{\mathrm{T}}\left[\begin{array}{rcc}1 & 0 & 1 \\ 0 & 1 & 1 \\ -1 & 0 & a \\ 0 & a & -1\end{array}\right]=\left[\begin{array}{cccc}1 & 0 & -1 & 0 \\ 0 & 1 & 0 & a \\ 1 & 1 & a & -1\end{array}\right]\left[\begin{array}{ccc}1 & 0 & 1 \\ 0 & 1 & 1 \\ -1 & 0 & a \\ 0 & a & -1\end{array}\right]$
$$=\left[\begin{array}{ccc} 2 & 0 & 1-a \\ 0 & 1+a^{2} & 1-a \\ 1-a & 1-a & 3+a^{2} \end{array}\right]$$

(II) 当 $a=-1$ 时, $\boldsymbol{A}^{\mathrm{T}} \boldsymbol{A}=\left[\begin{array}{lll}2 & 0 & 2 \\ 0 & 2 & 2 \\ 2 & 2 & 4\end{array}\right]$ 为实对称矩阵.
$$\left|\lambda \boldsymbol{E}-\boldsymbol{A}^{\mathrm{T}} \boldsymbol{A}\right|=\left|\begin{array}{ccc} \lambda-2 & 0 & -2 \\ 0 & \lambda-2 & -2 \\ -2 & -2 & \lambda-4 \end{array}\right|=\lambda(\lambda-2)(\lambda-6)$$

$\boldsymbol{\gamma}_{1}=\frac{1}{\sqrt{3}}(-1,-1,1)^{\mathrm{T}}, \quad \boldsymbol{\gamma}_{2}=\frac{1}{\sqrt{2}}(-1,1,0)^{\mathrm{T}}, \quad \gamma_{3}=\frac{1}{\sqrt{6}}(1,1,2)^{\mathrm{T}}$,

$$\text { 令 }\left[\begin{array}{l} x_{1} \\ x_{2} \\ x_{3} \end{array}\right]=\left[\begin{array}{ccc} -\frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ -\frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & \frac{2}{\sqrt{6}} \end{array}\right]\left[\begin{array}{l} y_{1} \\ y_{2} \\ y_{3} \end{array}\right], \quad \text { 则 } \boldsymbol{x}^{\mathrm{T}}\left(\boldsymbol{A}^{\mathrm{T}} \boldsymbol{A}\right) \boldsymbol{x}=\boldsymbol{y}^{\mathrm{T}} \Lambda \boldsymbol{y}=2 y_{2}^{2}+6 y_{3}^{2} \text {. }$$