One way is to look at the image. The interval length of image repetition is the period, which is [-π/2, π/2] in this question, so the period is π;
Another method is to use the definition: f(x)=|cosx|, so f (π+x) = | cos (π+x) | = |-cosx | = | cosx | = f (x), that is, f(π+x)=f(x), so the period is π.