ĐK: \(x\ne\dfrac{1\pm\sqrt{5}}{2}\)
TH1: \(x^2-x-1>0\Leftrightarrow\left[{}\begin{matrix}x>\dfrac{1+\sqrt{5}}{2}\\x< \dfrac{1-\sqrt{5}}{2}\end{matrix}\right.\)
\(\dfrac{\left|x^2-x\right|-2}{x^2-x-1}\ge0\)
\(\Leftrightarrow\left|x^2-x\right|-2\ge0\)
\(\Leftrightarrow\left|x^2-x\right|\ge2\)
\(\Leftrightarrow\left(\left|x^2-x\right|\right)^2\ge4\)
\(\Leftrightarrow x^4-2x^3+x^2-4\ge0\)
\(\Leftrightarrow\left(x-2\right)\left(x+1\right)\left(x^2-x+2\right)\ge0\)
\(\Leftrightarrow\left(x-2\right)\left(x+1\right)\ge0\)
\(\Leftrightarrow\left[{}\begin{matrix}x\ge2\\x\le-1\end{matrix}\right.\)
TH2: \(x^2-x-1< 0\Leftrightarrow\dfrac{1-\sqrt{5}}{2}< x< \dfrac{1+\sqrt{5}}{2}\)
\(\dfrac{\left|x^2-x\right|-2}{x^2-x-1}\ge0\)
\(\Leftrightarrow\left|x^2-x\right|\le2\)
\(\Leftrightarrow\left(x-2\right)\left(x+1\right)\left(x^2-x+2\right)\le0\)
\(\Leftrightarrow\left(x-2\right)\left(x+1\right)\le0\)
\(\Leftrightarrow-1\le x\le2\)
\(\Rightarrow\dfrac{1-\sqrt{5}}{2}< x< \dfrac{1+\sqrt{5}}{2}\)
Vậy \(S=[2;+\infty)\cup(-\infty;-1]\cup\left(\dfrac{1-\sqrt{5}}{2};\dfrac{1+\sqrt{5}}{2}\right)\)