Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I guess this is similar to the above comments, but notice that the Cayley-Hamilton theorem asserts that a certain polynomial of the matrix entries with integer coefficients is zero. It is thus enough to prove that it is zero on an open set. The set of matrices with distinct eigenvalues is open (discriminant argument if you will). The point here is that because the coefficients are integers, this proves that the said polynomial is zero regardless of which commutative ring you are working over.