\(x\left(x^2+1\right)=y\left(y^2+1\right)\\ \Leftrightarrow\left(x^3-y^3\right)+\left(x-y\right)=0\\ \Leftrightarrow\left(x-y\right)\left(x^2+xy+y^2\right)+\left(x-y\right)=0\\ \Leftrightarrow\left(x-y\right)\left(x^2+xy+y^2+1\right)=0\\ \Leftrightarrow x-y=0\left(\text{Vì }x^2+xy+y^2+1\ne0\right)\\ \Leftrightarrow x=y\)
Vậy \(S=\left\{Z|x=y\right\}\)