Step 1: Simplify the integral.
We start by splitting the integrand:
\[
\frac{x^2 - 2}{x^2 + 1} = \frac{x^2 + 1 - 3}{x^2 + 1} = 1 - \frac{3}{x^2 + 1}.
\]
Thus, the integral becomes:
\[
\int_0^1 \left( 1 - \frac{3}{x^2 + 1} \right) \, dx.
\]
Step 2: Perform the integration.
The first term integrates to \( x \), and the second term is a standard integral, yielding \( \frac{3\pi}{4} \). So the total integral is:
\[
\left[ x \right]_0^1 - 3 \left[ \tan^{-1} x \right]_0^1 = 1 - 3 \cdot \frac{\pi}{4} = 1 - \frac{3\pi}{4}.
\]
Step 3: Conclusion.
Thus, the correct answer is \( 1 - \frac{3\pi}{4} \), corresponding to option (B).