For positive integer $n$, find all pairs of coprime integers $p$ and $q$ such that $p+q^2=(n^2+1)p^2+q$
1. Start with the given equation:
   \[
   p + q^2 = (n^2 + 1)p^2 + q
   \]

2. Rearrange the equation to isolate terms involving \( p \) and \( q \):
   \[
   q^2 - q = (n^2 + 1)p^2 - p
   \]

3. Since \( p \) and \( q \) are coprime, consider the equation modulo \( p \):
   \[
   q^2 \equiv q \pmod{p}
   \]

4. This implies:
   \[
   q(q - 1) \equiv 0 \pmod{p}
   \]

5. Given that \( \gcd(p, q) = 1 \), \( p \) must divide \( q - 1 \). Therefore, we can write:
   \[
   q = kp + 1
   \]
   for some integer \( k \).

6. Substitute \( q = kp + 1 \) back into the original equation:
   \[
   p + (kp + 1)^2 = (n^2 + 1)p^2 + (kp + 1)
   \]

7. Expand and simplify:
   \[
   p + k^2p^2 + 2kp + 1 = (n^2 + 1)p^2 + kp + 1
   \]

8. Cancel out the common terms and rearrange:
   \[
   p + k^2p^2 + 2kp = (n^2 + 1)p^2 + kp
   \]
   \[
   p + k^2p^2 + kp = (n^2 + 1)p^2
   \]

9. Isolate the terms involving \( p \):
   \[
   p + kp = (n^2 + 1)p^2 - k^2p^2
   \]
   \[
   p(1 + k) = p^2((n^2 + 1) - k^2)
   \]

10. Divide both sides by \( p \) (since \( p \neq 0 \)):
    \[
    1 + k = p((n^2 + 1) - k^2)
    \]

11. Rearrange to solve for \( p \):
    \[
    p = \frac{1 + k}{n^2 + 1 - k^2}
    \]

12. Since \( p \) is an integer, \( n^2 + 1 - k^2 \) must divide \( 1 + k \). Consider the possible values of \( k \):
    - If \( k = n \), then:
      \[
      p = \frac{1 + n}{n^2 + 1 - n^2} = \frac{1 + n}{1} = n + 1
      \]

13. Substitute \( k = n \) back into the expression for \( q \):
    \[
    q = kp + 1 = n(n + 1) + 1 = n^2 + n + 1
    \]

14. Verify that \( (p, q) = (n + 1, n^2 + n + 1) \) satisfies the original equation:
    \[
    p + q^2 = (n + 1) + (n^2 + n + 1)^2
    \]
    \[
    (n^2 + 1)p^2 + q = (n^2 + 1)(n + 1)^2 + (n^2 + n + 1)
    \]

15. Simplify both sides to confirm they are equal.

16. Check that \( \gcd(n + 1, n^2 + n + 1) = 1 \):
    - Since \( n + 1 \) and \( n^2 + n + 1 \) are coprime, the solution is valid.

Therefore, the only solution is:
\[
(p, q) = (n + 1, n^2 + n + 1)
\]

The final answer is \( \boxed{ (p, q) = (n + 1, n^2 + n + 1) } \).