f(x)=x^2-2(2a-1)x+(2a-1)^2-(2a-1)^2+5a^2-4a+2
f(x)=(x-2a+1)^2+a^2-1
1.0≤2a-1≤1时,g(a)=a^2-1
2.2a-1≤0时,x取0,g(a)=(1-2a)^2+a^2-1
3.2a-1≥1时,x取1,g(a)=(2-2a)^2+a^2-1
f(x)=x^2-2(2a-1)x+(2a-1)^2-(2a-1)^2+5a^2-4a+2
f(x)=(x-2a+1)^2+a^2-1
1.0≤2a-1≤1时,g(a)=a^2-1
2.2a-1≤0时,x取0,g(a)=(1-2a)^2+a^2-1
3.2a-1≥1时,x取1,g(a)=(2-2a)^2+a^2-1