Five. (20 points) Try to find all ordered integer pairs $(a, b)$, such that the roots of the equation $x^{4}+\left(2 b-a^{2}\right) x^{2}$ $-2 a x+b^{2}-1=0$ are all integers.

Find all ordered integer pairs $(a, b)$, such that the roots of the equation $x^{4}+\left(2 b-a^{2}\right) x^{2} -2 a x+b^{2}-1=0$ are all integers.
Transform the original equation into
$$
\left(x^{2}+b\right)^{2}-(a x+1)^{2}=0 \text {, }
$$

which is $\left(x^{2}+a x+b+1\right)\left(x^{2}-a x+b-1\right)=0$.
Therefore, $x^{2}+a x+b+1=0$ and $x^{2}-a x+b-1=0$

have all integer roots. Thus,
$$
\Delta_{1}=a^{2}-4(b+1)=t_{1}^{2}, \Delta_{2}=a^{2}-4(b-1)=t_{2}^{2} \text {, }
$$

where $t_{1}$ and $t_{2}$ are non-negative integers.
By subtracting the two equations, we get
$$
8=t_{2}^{2}-t_{1}^{2}=\left(t_{2}-t_{1}\right)\left(t_{2}+t_{1}\right) \text {. }
$$

Therefore, $0 \leqslant t_{1}<t_{2}$, and $2=\frac{t_{2}-t_{1}}{2} \cdot \frac{t_{2}+t_{1}}{2}$.
Since $t_{2}-t_{1}$ and $t_{2}+t_{1}$ have the same parity, both $t_{2}-t_{1}$ and $t_{2}+t_{1}$ are even. Thus, we have
$$
\frac{t_{2}-t_{1}}{2}=1, \frac{t_{2}+t_{1}}{2}=2 \text {. }
$$

Therefore, $t_{1}=1, t_{2}=3$, which means $a^{2}-4 b-4=1, a^{2}-4 b+4=9$. So, $a^{2}-4 b=5, a$ must be odd.
Let $a=2 k-1(k \in \mathbf{Z})$, then
$$
4 b=a^{2}-5=4 k^{2}-4 k-4 \text {, }
$$

which means $b=k^{2}-k-1$.
At this point, the roots of $x^{2}+a x+b+1=0$ and $x^{2}-a x+b-1=0$ are $x=\frac{-a \pm t_{1}}{2}=-k+1$ or $-k$ and $x=\frac{a \pm t_{2}}{2}=k+1$ or $k-2$, all of which meet the requirements of the problem.

In summary, the ordered integer pairs $(a, b)$ are $a=2 k-1, b=k^{2}-k-1(\forall k \in \mathbf{Z})$.