Ending a clause with a preposition, rule of thumb or hard rule? [duplicate]

Solution 1:

I would say it's a rule of thumb, to avoid students make errors.

The NOAD, in the note about the usage of who versus whom reports that

The normal practice in modern English is to use who instead of whom and, where applicable, to put the preposition at the end of the sentence.
- Who do you think we should support?
- Who do you wish to speak to?

It also reports that

Such uses are today broadly accepted in standard English, but in formal writing it is best to maintain the distinction.

As you are using whom, the correct sentence is

To whom did you give the invitation?