The function is continuous at $x=\frac{\pi}{2}$ if the following equality holds:
$$\lim_{x\to \frac{\pi}{2}}f(x)=f\left(\frac{\pi}{2}\right)$$
In this case, we have:
$$\lim_{x\to \frac{\pi}{2}}f(x)=\lim_{x\to \frac{\pi}{2}}\frac{\lambda \cos x}{\frac{\pi}{2}-x}=\lambda$$
and:
$$f\left(\frac{\pi}{2}\right)=1$$
Therefore, for the function to be continuous at $x=\frac{\pi}{2}$, we need to have $\lambda=1$.
The other options are incorrect because they do not make the function continuous at $x=\frac{\pi}{2}$. For example, if $\lambda=0$, then the function would be equal to $0$ for all values of $x$, including $x=\frac{\pi}{2}$. This would mean that the function is not continuous at $x=\frac{\pi}{2}$, since the left-hand and right-hand limits of the function would be different.