$\begin{array}{l}P = \dfrac{\sqrt a -2}{1 - \sqrt a}- \dfrac{1 + \sqrt a}{2 + \sqrt a}+ \dfrac{3a -3 + 3\sqrt a}{a + \sqrt a -2}\\ ĐKXĐ: \, a \geq 0; a \ne 1\\ P = \dfrac{(2 - \sqrt a)(\sqrt a + 2)}{(\sqrt a -1)(\sqrt a + 2)}-\dfrac{(1 + \sqrt a)(\sqrt a -1)}{(\sqrt a -1)(\sqrt a + 2)}+\dfrac{3a - 3 + 3\sqrt a}{(\sqrt a -1)(\sqrt a + 2)}\\ =\dfrac{4 - a - (a - 1) + 3a - 3 + 3\sqrt a}{(\sqrt a -1)(\sqrt a + 2)}\\ = \dfrac{a + 3\sqrt a + 2}{(\sqrt a -1)(\sqrt a + 2)}\\ = \dfrac{(\sqrt a +1)(\sqrt a + 2)}{(\sqrt a -1)(\sqrt a + 2)}\\ =\dfrac{\sqrt a +1}{\sqrt a -1}\\ \text{Ta có:}\\ P = \dfrac{\sqrt a +1}{\sqrt a -1} = \dfrac{\sqrt a - 1 + 2}{\sqrt a - 1} = 1 + \dfrac{2}{\sqrt a -1}\\ P \in \Bbb Z \Leftrightarrow \dfrac{2}{\sqrt a - 1}\\ \Leftrightarrow \sqrt a - 1 \in Ư(2)=\left\{-2;-1;1;2\right\}\\ Do \,\,\sqrt a \geq 0\\ nên \,\,\sqrt a -1 \geq -1\\ \Rightarrow \sqrt a -1 = \left\{-1;1;2\right\}\\ \text{Ta có bảng giá trị:}\\\begin{array}{|l|r|}
\hline
\sqrt a - 1 & -1&1&2 \\
\hline
\sqrt a &0&2&3\\
\hline
a &0&4&9\\
\hline
\end{array}\\
\text{Vậy x = {0;4;9}}\end{array}$