Let $a$,$b$,and $c$ are roots of equations.
So, $(x-a)(x-b)(x-c)=0$
$=(x-a)(x^2-bx-cx+bc)$
$= x^3-ax^2-bx^2-cx^2+abx+bcx+cax-abc$
$=x^3-(a+b+c)x^2+(ab+bc+ca)x-abc $
Compare it with given equation$x^3-4x^2+6x+1$
$a+b+c =4$
$ab+bc+ca=6$
$abc=-1$
now, as we know $(a+b+c)^2= a^2+b^2+c^2+2ab+2bc+2ca$
so, $4^2= a^2+b^2+c^2+2\times6$
So, Sum of squares of roots , $a^2+b^2+c^2=16-12=4$