Our teacher told us that “l'Hexagone” was a rather French way of describing France (because apparently France looks like a hexagon). So when would it be appropriate to use? What prepositions would one use with it?
You would use the same prepositions as for the common word for an hexagone. It is used figuratively to refer to the territory of mainland France and by extension, to France itself, in the press, in books, on television etc. but less in every day conversations. It is also used in other French-speaking countries to refer to France (at least in Europe, I am not sure about Québec).
Cet opérateur de téléphonie couvre tout l'Hexagone.
Demain, il pleuvra sur tout l'Hexagone
On peut trouver ce journal partout dans l'Hexagone
There's also an adjective, hexagonal.
One time you can't use it is when talking about the president. I once said le président hexagonal and my friend couldn't correct me fast enough: le président de la République.
Another synonym: When in a DOM-TOM (any French territory outside of the Hexagon proper), the term used to talk about the mainland as opposed to Guadeloupe or wherever you currently are is typically la Métropole.