Some of the "rules" of English grammar that you learned in school were devised by pedants who believed that English was inferior to Latin and should be improved by forcing it onto the Procrustean bed of Latin grammar. But English is descended from an ancestral German dialect, not from Latin, and certain of the rules based on Latin grammar simply do not fit the structure of English.
Often what looks like a preposition in an English sentence is really not a preposition but a part of the verb (the technical term is adverbial particle). Consider these verbs: to put, to put up, to put up with. Obviously these are not the same verbs, and equally obviously the words that look like familiar prepositions are actually a part of each of the last two verbs.
Do you really want to be so "correct" as to complain, "That is the sort of thing up with which I will not put!" (Winston Churchill once used a similar remark to mock someone who had criticized him for ending a sentence with a preposition.)