It can't hurt to run the Apple Hardware Test. (See
Apple Hardware Test: iMac (Mid 2007) and later models or
Intel-based Macs: Using Apple Hardware Test for the details.) Note that it cannot detect every hardware issue, especially intermittent ones, but if it finds anything wrong you will know it needs service.
Note also that even if the iMac runs 10.6.2 fine, that does not necessarily mean there is nothing wrong with the hardware. Every version of the OS uses the hardware slightly differently & one usage pattern may reveal a fault in it that another won't, at least until it gets worse.
I have a G5 iMac like that: I started getting occasional random display anomalies in its behavior that at first were much more frequent when running 10.5 than 10.4, but eventually would show up with any OS version. Oddly, they don't show up at all in Classic mode windows when I run OS 9 applications using Tiger. Go figure.
Some users report using a third party utility to speed up the fans helps, but this is basically a bandaid, not a permanent cure.