f(x)=sin(π-wx)coswx+cos²wx=sinwxcoswx+cos²wx=(1/2)sin2wx+(1/2)cos2wx+1/2=(√2/2)sin(2wx+π/4)+1/2∵f(x)最小正周期为π∴2π/2w=πw=1∴f(x)=(√2/2)sin(2x+π/4)+1/2g(x)=(√2/2)sin(2*2x+π/4)+1/2=(√2/2)sin(4x+π/4)+1/20≤x≤π/16π/4≤4x+π/4≤π/21≤g(x)≤(√2/2)+1/2