Melchizedek appears mysteriously in the book of Genesis and is mentioned in several other places in the Bible. Let's look at those passages and see if we can determine who he is.
Abraham, before his name was changed by God, was met by Melchizedek after a long battle. Melchizedek provided a meal, which implies friendship, and blessed him. Abraham gave him a tenth of his spoils, which means Abraham recognized Melchizedek's greater spiritual authority. Melchizedek is not encountered again, nor is his lineage given, though Salem seems to be the foundation of the future royal city of Jerusalem.
David mentions him in the messianic Psalm 110: "You are a priest forever after the order of Melchizedek." Jesus references the Psalm in Matthew 24 to confirm that He is indeed of the lineage of David and Lord over King David. The verse from Psalm 110 is repeated a few times in the book of Hebrews as it teaches that Jesus is the only mediator between God and humanity. Chapter 7 begins with an explanation of what happened in Genesis 14 and then makes the argument that Jesus is our perfectly qualified and uniquely established high priest, superseding the Levitical priesthood established by the old covenant.
Hebrews does not tell us plainly that Melchizedek was Jesus appearing in human form to Abraham, but verse 3 says about him, "without father or mother, without genealogy, without beginning of days or end of life, resembling the Son of God, he remains a priest forever." The author may be speaking figuratively or literally. God definitely appeared to Abraham in human form in Genesis 17, so it is a possibility that he was what theologians call a theophany, an appearance of God in the Old Testament, or more specifically, a Christophany. If not a Christophany, at the very least, the appearance of Melchizedek in the book of Genesis helps us to understand God's eternally established design for the sacrifice of Jesus and the lasting and perfect New Covenant.