Find all pairs of positive integers $(a,b)$ such that $a^2 + b^2$ divides both $a^3 + 1$ and $b^3 + 1$.
To find all pairs of positive integers \((a, b)\) such that \(a^2 + b^2\) divides both \(a^3 + 1\) and \(b^3 + 1\), we proceed as follows:

1. **Divisibility Condition**:
   We need \(a^2 + b^2\) to divide both \(a^3 + 1\) and \(b^3 + 1\). This can be written as:
   \[
   a^2 + b^2 \mid a^3 + 1 \quad \text{and} \quad a^2 + b^2 \mid b^3 + 1.
   \]

2. **Using Polynomial Identities**:
   Consider the expression \(a^3 - b^3\):
   \[
   a^3 - b^3 = (a - b)(a^2 + ab + b^2).
   \]
   Since \(a^2 + b^2\) divides both \(a^3 + 1\) and \(b^3 + 1\), it must also divide their difference:
   \[
   a^2 + b^2 \mid (a^3 + 1) - (b^3 + 1) = a^3 - b^3.
   \]
   Therefore,
   \[
   a^2 + b^2 \mid (a - b)(a^2 + ab + b^2).
   \]

3. **Greatest Common Divisor (GCD) Analysis**:
   Let \(\gcd(a, b) = d\). Then we can write \(a = da_1\) and \(b = db_1\) where \(\gcd(a_1, b_1) = 1\). Substituting these into the divisibility condition, we get:
   \[
   (d^2a_1^2 + d^2b_1^2) \mid d^3a_1^3 + 1 \quad \text{and} \quad (d^2a_1^2 + d^2b_1^2) \mid d^3b_1^3 + 1.
   \]
   Simplifying, we have:
   \[
   d^2(a_1^2 + b_1^2) \mid d^3a_1^3 + 1 \quad \text{and} \quad d^2(a_1^2 + b_1^2) \mid d^3b_1^3 + 1.
   \]

4. **Simplifying the Divisibility**:
   Since \(\gcd(a_1, b_1) = 1\), it follows that \(a_1^2 + b_1^2\) must divide \(d\). Therefore, we have:
   \[
   a_1^2 + b_1^2 \mid d.
   \]
   Also, since \(d \mid a\) and \(d \mid b\), we have:
   \[
   d \ge a_1^2 + b_1^2.
   \]

5. **Bounding \(d\)**:
   Suppose \(d = 1\). Then \(a = a_1\) and \(b = b_1\), and we need:
   \[
   a_1^2 + b_1^2 \mid a_1^3 + 1 \quad \text{and} \quad a_1^2 + b_1^2 \mid b_1^3 + 1.
   \]
   For \(a_1 = 1\) and \(b_1 = 1\), we have:
   \[
   1^2 + 1^2 = 2 \mid 1^3 + 1 = 2,
   \]
   which is true. Thus, \((a, b) = (1, 1)\) is a solution.

6. **Contradiction for \(d > 1\)**:
   Suppose \(d > 1\). Then:
   \[
   d^2(a_1^2 + b_1^2) \mid d^3a_1^3 + 1.
   \]
   Since \(d^2(a_1^2 + b_1^2) \ge d^3\), this implies:
   \[
   d^2(a_1^2 + b_1^2) \ge d^3a_1^3 + 1,
   \]
   which is a contradiction because \(d^3a_1^3 + 1\) is not divisible by \(d^2(a_1^2 + b_1^2)\) unless \(a_1 = b_1 = 1\).

Therefore, the only solution is \((a, b) = (1, 1)\).

The final answer is \(\boxed{(1, 1)}\).