Lời giải:
ĐK: $x\geq 0$
$P=\frac{\sqrt{x}+6}{\sqrt{x}+1}=1+\frac{5}{\sqrt{x}+1}$
Để $P$ nguyên thì $\frac{5}{\sqrt{x}+1}$ là số nguyên.
Hiển nhiên $\frac{5}{\sqrt{x}+1}>0$
$\sqrt{x}\geq 0\Rightarrow \sqrt{x}+1\geq 1\Rightarrow \frac{5}{\sqrt{x}+1}\leq 5$
Vậy $0< \frac{5}{\sqrt{x}+1\leq 5$
Do đó $\frac{5}{\sqrt{x}+1}$ nguyên khi $\frac{5}{\sqrt{x}+1}\in \left\{1; 2; 3; 4; 5\right\}$
$\Leftrightarrow \sqrt{x}\in \left\{4; \frac{3}{2}; \frac{2}{3}; \frac{1}{4}; 0\right\}$
$\Rightarrow x\in \left\{16; \frac{9}{4}; \frac{4}{9}; \frac{1}{16}; 0\right\}$