The correct option is B λ=1
As, period of f(x) is π2
⇒f(π2+x)=f(x) ∀ x∈R
⇒λ|cosx|+λ2|sinx|+g(λ)=λ|sinx|+λ2|cosx|+g(λ)
⇒(λ−λ2)|cosx|+(λ2−λ)|sinx|=0 ∀ x ∈R
⇒λ−λ2=0 or |sinx|=|cosx|
⇒λ=0,1 or x=(2n+1)π4,n∈Z
But at λ=0,f(x) becomes a constant function, so λ≠0
⇒λ=1 or x=(2n+1)π4,n∈Z