Let us assume $(a^2 + b^2)/(ab + 1) = k \in \mathbb{N}$. We then have $a^2 - kab + b^2 = k$. Let us assume that $k$ is not an integer square, which implies $k \ge 2$. Now, we observe the minimal pair $(a, b)$ such that $a^2 - kab + b^2 = k$ holds. We may assume, without loss of generality, that $a \ge b$. For $a = b$, we get $k = (2 - k)a^2 \le 0$, so we must have $a > b$.
Let us observe the quadratic equation $x^2 - kbx + b^2 - k = 0$, which has solutions $a$ and $a_1$. Since $a+ a_1 = kb$, it follows that $a_1 \in \mathbb{Z}$. Since $a > kb$ implies $k > a + b^2 > kb$ and $a = kb$ implies $k = b^2$, it follows that $a < kb$ and thus $b^2 > k$. Since $aa_1 = b^2 - k > 0$ and $a>0$, it follows that $a_1 \in \mathbb{N}$ and $a_1 = (b^2 - k)/a < (a^2 - 1)/a < a$. We have thus found an integer pair $(a_1, b)$ with $0 < a_1 < a$ satisfies the original equation. This is a contradiction of the initial assumption that $(a, b)$ is minimal. Hence, $k$ must be an integer square.