For a probability distribution function to be valid, the integral of the function over all possible values must be 1. That is,
\[
\int_{-\infty}^{\infty} f_X(x) \, dx = 1.
\]
Given the function
\[
f_X(x) = \frac{1}{\pi} \left( \frac{q}{e^x + e^{-x}} \right),
\]
we can simplify \( e^x + e^{-x} \) as \( 2\cosh(x) \), where \( \cosh(x) \) is the hyperbolic cosine function. Thus, the integral becomes:
\[
\int_{-\infty}^{\infty} \frac{q}{\pi} \cdot \frac{1}{2 \cosh(x)} \, dx.
\]
The integral of \( \frac{1}{\cosh(x)} \) over all \( x \) is a known result and equals \( \pi \). Therefore,
\[
\frac{q}{2\pi} \cdot \pi = 1 $\Rightarrow$ \frac{q}{2} = 1 $\Rightarrow$ q = 2.
\]
Thus, the correct value of \( q \) is Option (A).