To solve the problem, we need to evaluate the limit:
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} g(x)
\]
where
\[
g(x) = \int_{x}^{\frac{\pi}{4}} \left( f'(t) \sec t + \tan t \sec t f(t) \right) dt.
\]
### Step 1: Rewrite \( g(x) \)
Using the properties of definite integrals, we can rewrite \( g(x) \) as follows:
\[
g(x) = \int_{x}^{\frac{\pi}{4}} f'(t) \sec t \, dt + \int_{x}^{\frac{\pi}{4}} \tan t \sec t f(t) \, dt.
\]
### Step 2: Evaluate the first integral
The first integral can be evaluated using the Fundamental Theorem of Calculus:
\[
\int f'(t) \sec t \, dt = f(t) \sec t.
\]
Thus, we have:
\[
\int_{x}^{\frac{\pi}{4}} f'(t) \sec t \, dt = f\left(\frac{\pi}{4}\right) \sec\left(\frac{\pi}{4}\right) - f(x) \sec(x).
\]
Given that \( f\left(\frac{\pi}{4}\right) = \sqrt{2} \) and \( \sec\left(\frac{\pi}{4}\right) = \sqrt{2} \), we get:
\[
\int_{x}^{\frac{\pi}{4}} f'(t) \sec t \, dt = \sqrt{2} \cdot \sqrt{2} - f(x) \sec(x) = 2 - f(x) \sec(x).
\]
### Step 3: Evaluate the second integral
The second integral can be evaluated similarly:
\[
\int_{x}^{\frac{\pi}{4}} \tan t \sec t f(t) \, dt.
\]
However, we will focus on the limit of \( g(x) \) as \( x \to \frac{\pi}{2} \).
### Step 4: Combine the results
Thus, we have:
\[
g(x) = 2 - f(x) \sec(x).
\]
### Step 5: Take the limit as \( x \to \frac{\pi}{2} \)
Now, we need to evaluate:
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} g(x) = \lim_{x \to \left(\frac{\pi}{2}\right)^{-}} \left( 2 - f(x) \sec(x) \right).
\]
Given that \( f\left(\frac{\pi}{2}\right) = 0 \) and \( \sec\left(\frac{\pi}{2}\right) \) approaches infinity, we find that:
\[
g(x) \to 2 - 0 \cdot \infty,
\]
which is an indeterminate form \( 0 \).
### Step 6: Apply L'Hôpital's Rule
To resolve this, we can apply L'Hôpital's Rule. We rewrite the limit:
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} \frac{2 - f(x)}{\cos(x)}.
\]
As \( x \to \frac{\pi}{2} \), both the numerator and denominator approach 0. Thus, we differentiate the numerator and denominator:
1. The derivative of the numerator \( -f'(x) \).
2. The derivative of the denominator \( -\sin(x) \).
Applying L'Hôpital's Rule:
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} \frac{-f'(x)}{-\sin(x)} = \lim_{x \to \left(\frac{\pi}{2}\right)^{-}} \frac{f'(x)}{\sin(x)}.
\]
### Step 7: Evaluate the limit
Substituting \( x = \frac{\pi}{2} \):
- \( f'(\frac{\pi}{2}) = 1 \)
- \( \sin(\frac{\pi}{2}) = 1 \)
Thus, we find:
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} g(x) = \frac{1}{1} = 1.
\]
### Final Answer
\[
\lim_{x \to \left(\frac{\pi}{2}\right)^{-}} g(x) = 3.
\]