You have to be sure your teacher has a good sense of humor before you criticize the way he dresses, otherwise you might be scolded for your impertinence. Impertinence means "being rude, insolent, or inappropriately playful."
Impertinence seems like a word that was invented for adults to use when they're complaining about rude or disrespectful kids. Sometimes you might think you're being funny or playful, but what you're saying can come across as impertinence to someone who expects to be treated with respect. The Latin root is impertinentem, or "not belonging." When someone shows impertinence, they act in a way that doesn't belong, or fit the situation.