3. Let [x] denote the greatest integer not exceeding $x$, then the sum of the squares of all real roots of the equation $x^{2}-5[x]+4=0$ is

保留源文本的换行和格式，直接输出翻译结果。
Solve: The intersection points of the graphs of the functions $y=x^{2}$ and $y=5[x]-4$ (see the figure below) are the solutions to the original equation.  
From $5[x]=x^{2}+4>0$, we know that $[x]>0$.  
Therefore, we only  
need to consider the case where $x \geqslant 1$.  
Since $x \geqslant[x]$,  
substituting into the original equation gives $[x]^{2}-5[x]+4 \leqslant 0$.  
Thus, $[x] \in[1,4]$.  
When $[x]=1$, $x^{2}=5-4=1$, and $x=1$ satisfies the requirement $[x]=1$, so $x=1$ is a solution to the original equation;  
Similarly, when $[x]=2,3,4$, it is easy to see that $x=\sqrt{6}$, $\sqrt{11}$, $4$ are also solutions to the original equation. Therefore, the sum of the squares of all roots is  
$$
1+6+11+16=34 \text {. }
$$

Note: This problem can also be solved using congruence relations.