From A Dictionary of Modern English Usage by H. W. Fowler, Oxford UP, 1926, 457-458:
PREPOSITION AT END. It is a cherished superstition that prepositions must, in spite of the incurable English instinct for putting them late (‘They are the fittest timber to make great politics of' said Bacon; & ’What are you hitting me for?; says the modern schoolboy), be kept true to their name &n placed before the word they govern. ‘A sentence ending in a preposition is an inelegant sentence’ represents a very general belief. One of its chief supports is the fact that Dryden, an acknowledge master of English prose, went through all his prefaces contriving away the final prepositions that he had been guilty of in his first editions. It is interesting to find Ruskin almost reversing this procedure. In the text of the Seven Lamps there is a solitary final preposition to be found, & no more; but in the later footnotes they are not avoided (Any more wasted words … I never heard of. / Men whose occupation for the next fifty years would be the knocking down every beautiful building they could lay their hands on). Dryden’s earlier practice shows him following the English instinct; his later shows him sophisticated with deliberate latinism:- ‘I am often put to a stand in considering whether what I write be the idiom of the tong, … & have no other way to clear my doubts but by translating my English into Latin’; the natural inference in this mater would be: you cannot put a preposition (roughly speaking) later than its word in Latin, & therefore you must not do so in English. Gibbon improved upon the doctrine, &, observing that prepositions & adverbs are not always easily distinguished, kept on the safe side by not ending sentences with on, over, under, or the like, even when they would have been adverbs.
The fact is that the remarkable freedom enjoyed by English in putting its prepositions late & omitting its srelatives is an important element in the flexibility of the language. The power of saying A state of dejection such as they are absolute strangers to (Cowper) instead of A state of dejection of an intensity to which they are absolute strangers, or People worth talking to instead of People with whom it is worth while to talk, is not one to be lightly surrendered. But the Dryden-Gibbon tradition has remained in being, & even now immense pains are daily expended in changing spontaneous into artificial English. That depends on what they are cut with is not improved by conversion into That depends on with what they are cut; & too often the lust of sophistication, once blooded becomes uncontrollable, & ends with, That depends on the answer to the question as to with what they are cut. Those who lay down the universal principle that final prepositions are ‘inelegant’ are unconsciously trying to deprive the English language of a valuable idiomatic resource, which has been used freely by all our greatest writers except those whose instinct for English idiom has been overpowered by notions of correctness derived from Latin standards. The legitimacy of the prepositional ending in literary English must be uncompromisingly maintained; in respect of elegance or inelegance, every example must be judged not by any arbitrary rule, but on its own merits, according to the impression it makes on the feeling of educated English readers.
In avoding the forbidden order, unskilful handlers of words often fall into real blunders (see OUT OF THE FRYING-PAN). A few examples of bad grammar obviously due to this cause may fairly be offered without any suggestion that a rule is responsible for all blunders made in attempting to keep it; the words in brackets indicate the avoided form, which is not necessarily the best, but is at least better than that substituted for it:- The War Office did not care, the Disposal Board is indifferent, & there is no-one on whom to fix the blame or to hang (no-one to fix the blame on or to hang). / The day begins with a ride with the wife & as many others as want to ride & for whom there is horseflesh available (& as there are horses for). / The question of an equal repartition of the cost of reparation, as well as of the interest & reimbursement of capital invested, is on what the whole matter hinges (is what the whole matter hinges on). / It is like the art of which Huysmans dreamed but never executed (the art that Huysmans dreamed of). / Recognition is given to it by no matter whom it is displayed (no matter whom it is displayed by). / That promised land for which he was to prepare, but scarcely to enter (that he was to prepare for).
It was said above that almost all our great writers have allowed themselves to end a sentence or a clause with a preposition. A score of specimens follow ranging over six centuries, to which may be added teh Bacon, Cowper, & Ruskin examples already given:- (Chaucer) But yit to this thing there is yit another thing y-ioigned, more to ben wondred upon. (Spenser) Yet childe ne kinsman living had he none To leave them to. (Shakespeare) Such bitter business as the day Would quake to look on. (Jonson) Prepositions follow sometimes the nouns they are coupled with. (Bible) I will not leave thee, until I have done that which I have spoken to thee of. (Milton) What a fine conformity would it starch us all into. (Burton) Fit for Calphurnius & Democritus to laugh at. (Pepys) There is good ground for what he goes about. (Congreve) And where those qualities are, ‘tis pity they should want objects to shine upon. (Swift) The present argument is the most abstracted that ever I engaged in. (Defoe) Avenge the injuries … by giving them up to the confusions their madness leads them to. (Burke) The less convincing on account of the party it came from. (Lamb) Enforcing his negation with all the might … he is master of. (De Quincey) The average, the prevailing tendency, is what we look at. (Landor) The vigorous mind has mountains to climb, & valleys to repose in. (Hazlitt) It does for something to talk about. (Peacock) Which they would not otherwise have dreamed of. (Mill) We have done the best that the existing state of human reason admits of. (Kinglake) More formidable than any … that Ibrahim Pasha had to contend with. (M. Arnold) Let us see what it amounts to. (Lowell) Make them show what they are made of. (Thackeray) So little do we know what we really are after. (Kipling) Too horrible to be trifled with.
If it were not presumptuous, after that, to offer advice, the advice would be: Follow no arbitrary rule, but remember that there are often two or more possible arrangements between which a choice should be consciously made; if the abnormal, or at least unorthodox, final preposition that has naturally presented itself sounds comfortable, keep it; if it does not sound comfortable, still keep it if it has compensating vigour, or when among awkward possiblities it is the least awkward.
‘Not ending sentences with prepositions was encoded by a British guy named Henry Fowler in 1926. He was a crotchety, proscriptionist pedant, but his book was a best seller. People wanted guidance about how to speak and write “properly,” especially in class-conscious England. So a rule to not use words like “to,” “in,” “for,” “with,” or “on” as the last word in a sentence became wildly popular as a marker of a well-bred, well-educated person. But it was really just Fowler’s personal preference, and today the practice seems like an affectation.’