Solution (source code)

= Solution

Put $A=\lambda I-T$. Since $T$ is a <self-adjoint operator>, $A^*=\overline\lambda I-T$. Applying the preceding <image-kernel orthogonality for an adjoint> identities to $A^*$ gives
$$
\overline{\operatorname{Im}A}=(\ker A^*)^\perp.
$$
If $\lambda$ is real, $A^*=A$ and $\ker A=\{0\}$ because $\lambda$ is not an <eigenvalue>. If $\lambda$ is nonreal and $A^*x=0$, then $Tx=\overline\lambda x$. The scalar $\langle Tx,x\rangle$ is real by <self-adjointness>, while it equals $\overline\lambda\|x\|^2$. Its imaginary part forces $x=0$. Thus $\ker A^*=\{0\}$ in both cases, and
$$
\boxed{\overline{\operatorname{Im}(\lambda I-T)}=X.}
$$
The conjugation on $\lambda$ in the <adjoint operator> is essential when $\lambda$ is nonreal.