f(x)=cos2x+cosx+1
=2cos^2x-1+cosx+1
=2cos^2x+cosx
=2(cos^2x+cosx/2+1/8)-1/4
=2(cosx+1/4)^2-1/4
所以值域是[-1/4,23/8]