f(x)=1/a(x-1/a)^2-1-1/a^2
(1)1/a≤1,a≥1,fmax=f(3)=9a-7
fmin=f(1)=a-3
g(a)=8a-4,a≥1,gmin=4
(2)1<1/a≤2,1/2≤a<1,fmax=f(3)=9a-7
fmin=f(1/a)=-1-1/a^2
g(a)=9a+1/a^2-6,1<1/a≤2,gmin=4
(3)2<1/a≤3,1/3≤a<1/2,fmax=f(1)=a-3
fmin=f(1/a)=-1-1/a^2
g(a)=a+1/a^2-2,gmin=5/2
(3)1/a>3,0 fmin=f(3)=9a-7
g(a)=4-8a,gmin=4/3