J. Paul Sampley discusses the "hymn to charity" in 1 Corinthians 13; concludes that it was composed by Paul and is original to the epistle.
J. Paul Sampley, “The First Letter to the Corinthians,” in The New Interpreter’s Bible, 12 vols. (Nashville: Abingdon Press, 2002), 10: 951
Some scholars have suggested that Paul did not compose chap. 13 but knew it from elsewhere and incorporated it into his argument. Others have posited that one can read from 12:31 to chap. 14 with no interruption of Paul’s argument, that Paul did not compose chap. 13, and that a later redactor of the Pauline corpus put it where it is. Surely one can construe chaps. 12-14 in that fashion, but to do so overlooks some distinct functions of chap. 13. First, the chapter gives perspective and balance to the matter at hand—namely, proper use and understanding of spiritual gifts in the Corinthian church. Second the chapter has many significant links to the rest of the letter so that it also serves to recapitulate several concerns already registered by Paul. Third, rhetorical handbooks saw such a change of pace and concentration as a powerful way of focusing the auditors’ attention. Paul is surely capable of lofty composition, and chap. 13 serves too many of his concerns not to have belonged there from the start.