f(x)=sinx-cosx=√2sin(x-π/4)
(1),最大值为√2,最小值为-√2
(2)当x∈[-π/4,π/4]时,x-π/4∈[-π/2,0],
所以f(x)=√2sin(x-π/4)=[-√2,0],最大值为0,最小值为-√2.