Elena Kornyshonkova, 40, from Tver, in Russia, said she posted the revealing photo by accident on the Russian social network VKontake.
Students and colleagues found her nude selfie and reported this to the school management, media reports said.
In her reply, the teacher said there was nothing wrong with nudity and she led a more "honourable" life than many of her colleagues.
According to her, she only intended her close friends to see the picture taken during a holiday in Spain.
But the school management directed her to resign by Aug 25 else threatened to sack her, reports added.