I agree that it is courteous not to infect the people around you when you are sick, but I think there is more to it than that. One should not quarantine oneself for non-serious illnesses.
Colds and flus are around us at all times, we only catch them when WE become vulnerable. If you are at the gym with a cold, the only people who you could infect would be the ones who are vulnerable, and if they didn't catch it from you, they would have caught something from someone else.
In reponse to the original post, I play it by ear, basically listen to my body. Sometimes I perform the best when dealing with a light cold.