Example 5 (2003 2004 Swedish Mathematical Competition) Find all real numbers $x$ that satisfy the equation $\left[x^{2}-2 x\right]+2[x]=$ $[x]^{2}$, where $[a]$ denotes the greatest integer less than or equal to $a$.


Analyzing $\left[x^{2}-2 x\right]$ is relatively complex, so we consider using substitution to simplify it.
Let $x=y+1$, then the original equation becomes
$$\left[(y+1)^{2}-2(y+1)\right]+2[y+1]=[y+1]^{2},$$

which is $\left[y^{2}-1\right]+2[y+1]=[y+1]^{2}$,
or $\left[y^{2}\right]-1+2[y]+2=[y]^{2}+2[y]+1$.
or $\left[y^{2}\right]=[y]^{2}$.
Let $n=[y]$, then $\left[y^{2}\right]=n^{2}$, so $n^{2} \leqslant y^{2}<n^{2}+1$.
Thus $|n| \leqslant y<\sqrt{n^{2}+1}$ or $-\sqrt{n^{2}+1}<y \leqslant-|n|$.
When $n \in \mathbf{N}$, $n \leqslant y<\sqrt{n^{2}+1}$, satisfying $n=[y]$;
When $n \notin \mathbf{N}$, i.e., $n \leqslant-1$, $-\sqrt{n^{2}+1}<y \leqslant n$, combined with $n=[y]$ we know that in this case it can only be $y=n$. Therefore, $y \in \mathbf{Z} \cup\left[n, \sqrt{n^{2}+1}\right)(n \in \mathbf{N})$.
Thus, $x \in \mathbf{Z} \cup\left[n+1, \sqrt{n^{2}+1}+1\right)(n \in \mathbf{N})$.