Substituting $x=1-x$, we have
$f(1-x)+(1-x)f(x)=x^2-2x+2$
Multiplying this by $x$, we have
$xf(1-x)+x(1-x)f(x)=x^3-2x^2+2x$
Subtracting our original equation from this, we have
$f(x)+xf(1-x)-[xf(1-x)+x(1-x)f(x)]=x^2+1-(x^3-2x^2+2x)$
$f(x)-x(1-x)f(x)=-x^3+3x^2-2x+1$
$[1-x(1-x)]f(x)=-x^3+3x^2-2x+1$
$f(x)=\frac{-x^3+3x^2-2x+1}{x^2-x+1}$