I am trying to do an exercise that goes like this
Let $H$ be an Hilbert space and $T:H\rightarrow H$ a bounded self-adjoint linear operator and $T\neq 0$ then $T^n\neq 0$.
So my idea was to do this by induction on $n$. Suppose that $T^2=0$ then we will have that $\langle T^2x,x\rangle=0 ,\forall x\in X$ and so we will have that $||Tx||^2=0,\forall x\in X$ in contradiction with the fact that $T\neq 0$. Now suppose that $T^n=0$, this means that $ImT^{n-1}\neq 0 \subset Ker T$. Now we now that the operator $T^{n-1}$ is self-adjoint since $T$ is self-adjoint and commutes with itself so we will have that $ImT^{n-1}\subseteq(KerT^{n-1})^\perp$ and since $Ker T\subseteq Ker T^{n-1}$ we have that $(KerT^{n-1})^{\perp} \subseteq(KerT)^{\perp}$ and so we have that $Im T^{n-1}=\{0\}$, in contradiciton with our induction Hypothesis. Is this correct or is there a better more elegant way to do this ? Thanks in advance!
Your proof is correct.
For a slightly shorter proof, observe that your first implication $T^2=0 \implies T=0$ generalizes to $T^{2^n}=0 \implies T=0$ by induction, so if $T^m=0$ then $T^{2^n}=0$ for any $m\le 2^n$, and hence $T=0$ follows.