At this point I think you'll need to see whats happening with the sensors. Download this app: Temperature Gauge Pro. Post a snapshot of what it shows here for us to see.
At this point I would start off replacing the CPU fan unit. Here's the IFIXIT guide to follow: iMac Intel 24" EMC 2111 CPU Fan Replacement.
The other possibility which is much harder to replace is the CPU heat sink. While rare the copper tubes are filled with liquid and this liquid can leak out causing the CPU not to be cooled and why the fan is pegged as the heat sensor is on the CPUs heat sink pad. Here is the IFIXIT guide to follow if the replacement fan failed to fix things: iMac Intel 24" EMC 2111 CPU Replacement. I must warn you this is a very big job.
I have never seen a sensor failure in this series but its possible the connector on the sensor cable came off if someone every took the logic board out. As this is not easy to get to its the very last possibility.