Q:

Question concerning a prepositional phrase

In the prepositional phrase : "Who did you give your number to?" Is the TO at the end of the sentence absolutely necessary?

A:

In American English, these two are colloquial:

Who did you give your number to? 
Who did you give your number?

and this is formal:

To whom did you give your number?

A:

The verb give participates in something called the Dative Alternation:

I gave the book to him.
  I gave him the book.

Both of these sentences can be used with the same meaning.  Levin gives the following examples of verbs that participate in the Dative Alternation:

give-type verbs: give, hand, lend, loan, rent, sell, . . . 
send-type verbs: send, mail, ship, . . . 
throw-type verbs: fling, flip, kick, lob, slap, shoot, throw, toss, . . .

But the example I've given above is very simple.  If we make things more cognitively complex by making the example interrogative, then we find a strong preference for the version that is explicitly marked by a preposition.  Why?  
In Cognitive complexity and increased grammatical explicitness in English, Günter Rohdenburg outlines his Complexity Principle, "explicitly marked phrases are preferred over zero-marked counterparts in cognitively complex environments".  Following this principle, it seems many speakers have a strong preference for including to in the interrogative version:

Who did John give the book?
  Who did John give the book to?

I personally find both versions grammatical, but I think you'll find that people usually choose to include this preposition in real life examples.

