Cry Wolf said:
You're trying to prove to others that you do not exist, rather than yourself, regardless of the actual assignment question. Descartes' much recited phrase 'Cogito Ergo Sum' only proves to the thinker that he exists. His problem is discerning whether everything external exists, as the senses are fallible - ala The Matrix.
Thus, you argue with the class. How do they know you exist? How can they trust their senses? How do they know you think? This path will require you to be quick witted and well versed in the musings of a plethora of famous philosophers.
The other option has been stated before. Don't turn up, and have a friend simple ask "Who?" when the roll is called. However, this really depends on your philosophy teacher as I've known those who'd fail you for such an action, or given you top marks.
This is the best answer to your question from the ones I've read.
"I think therefore I am" is pretty tough to invalidate, but that only works for proving to yourself that you exist. Because your senses can be fooled there is no way of knowing if everyone else actually exists or is just a trick of the mind, much like dreams are. They can say they think, so they know they exist, but there's no way YOU can know if they think.
To thier senses, you do not think, therefore you do not exist. Try working with that.