The function \( f(x) \) is defined piecewise:
1. \( f(x) = mx + 1 \) for \( x \leq \frac{\pi}{2} \),
2. \( f(x) = \sin x + n \) for \( x>\frac{\pi}{2} \).
We are asked to find the values of \( m \) and \( n \) such that \( f(x) \) is continuous at \( x = \frac{\pi}{2} \).
Step 1: Continuity condition at \( x = \frac{\pi}{2} \).
For \( f(x) \) to be continuous at \( x = \frac{\pi}{2} \), the following condition must hold:
\[
\lim_{x \to \frac{\pi}{2}^-} f(x) = \lim_{x \to \frac{\pi}{2}^+} f(x) = f\left( \frac{\pi}{2} \right).
\]
This means the left-hand limit (as \( x \to \frac{\pi}{2}^- \)) must equal the right-hand limit (as \( x \to \frac{\pi}{2}^+ \)), and both must equal the value of the function at \( x = \frac{\pi}{2} \).
Step 2: Left-hand limit.
For \( x \leq \frac{\pi}{2} \), \( f(x) = mx + 1 \). So, the left-hand limit is:
\[
\lim_{x \to \frac{\pi}{2}^-} f(x) = m\left( \frac{\pi}{2} \right) + 1.
\]
Step 3: Right-hand limit.
For \( x>\frac{\pi}{2} \), \( f(x) = \sin x + n \). So, the right-hand limit is:
\[
\lim_{x \to \frac{\pi}{2}^+} f(x) = \sin\left( \frac{\pi}{2} \right) + n = 1 + n.
\]
Step 4: Equating the limits.
For continuity, the left-hand and right-hand limits must be equal. So, we have:
\[
m\left( \frac{\pi}{2} \right) + 1 = 1 + n.
\]
Simplifying:
\[
m \frac{\pi}{2} + 1 = 1 + n.
\]
Subtracting 1 from both sides:
\[
m \frac{\pi}{2} = n.
\]
Thus, the relationship between \( m \) and \( n \) is:
\[
n = m \frac{\pi}{2}.
\]
Step 5: Conclusion.
Therefore, the correct answer is (c) \( n = m \frac{\pi}{2} \).