a)
\(\begin{array}{l}
Q = \left( {\dfrac{{\sqrt x + 2}}{{x + 2\sqrt x + 1}} - \dfrac{{\sqrt x - 2}}{{x - 1}}} \right).\dfrac{{\sqrt x + 1}}{{\sqrt x }}\\
= \left[ {\dfrac{{\sqrt x + 2}}{{{{\left( {\sqrt x + 1} \right)}^2}}} - \dfrac{{\sqrt x - 2}}{{\left( {\sqrt x + 1} \right)\left( {\sqrt x - 1} \right)}}} \right].\dfrac{{\sqrt x + 1}}{{\sqrt x }}\\
= \dfrac{{\left( {\sqrt x + 2} \right)\left( {\sqrt x - 1} \right) - \left( {\sqrt x - 2} \right)\left( {\sqrt x + 1} \right)}}{{{{\left( {\sqrt x + 1} \right)}^2}\left( {\sqrt x - 1} \right)}}.\dfrac{{\sqrt x + 1}}{{\sqrt x }}\\
= \dfrac{{x - \sqrt x + 2\sqrt x - 2 - \left( {x + \sqrt x - 2\sqrt x - 2} \right)}}{{{{\left( {\sqrt x + 1} \right)}^2}\left( {\sqrt x - 1} \right)}}.\dfrac{{\sqrt x + 1}}{{\sqrt x }}\\
= \dfrac{{2\sqrt x }}{{\left( {\sqrt x + 1} \right)\left( {\sqrt x - 1} \right)}}.\dfrac{1}{{\sqrt x }}\\
= \dfrac{2}{{x - 1}}
\end{array}\)
b) $Q$ có giá trị nguyên khi $2$ $\vdots$ $x-1$
$\Rightarrow x-1\in Ư(2)=\{\pm1;\pm2\}$
Ta có bảng giá trị như hình vẽ.