Solution (source code)

= Solution

Write $v=\sigma^2$. For one observation, the score is
$$
s_\mu(x;\mu,v)=\frac{x-\mu}{v},
\qquad
s_v(x;\mu,v)=-\frac1{2v}+\frac{(x-\mu)^2}{2v^2},
$$
and
$$
I_1(\mu,v)=
\begin{pmatrix}v^{-1}&0\\0&(2v^2)^{-1}\end{pmatrix}.
$$
Under the restriction $v=1$, the <restricted maximum-likelihood estimator> is $\widetilde\mu=\bar X$. At $(\bar X,1)$ the first score component is zero, while the second is
$$
\frac12\sum_{i=1}^n\bigl((X_i-\bar X)^2-1\bigr).
$$
Since $I_1(\bar X,1)^{-1}=\operatorname{diag}(1,2)$, substitution into the score statistic gives
$$
\boxed{
T_n=\left[\frac1{\sqrt{2n}}
\sum_{i=1}^n\bigl((X_i-\bar X)^2-1\bigr)\right]^2.}
$$