I know that on Mars, radiation levels are quite high (turns out lack of an atmosphere does that). On the rovers that are sent to Mars, etc. How is radiation kept from playing havoc with the rover's electronics?
This is the same as if you were to protect a satellite from radiation in outer space. It is a field of study in Radiation Hardening. For instance, your desktop pc may not have ECC ram so if an error occurs windows just crashes. In server hardware however there is ECC, redundancy and test patterns. These are things that are used to mitigate errors in electronics so that the software does not produce errors. Satellites and Rovers take it to the next level.