What is the purpose of prophecy in Scripture? Or, rather, what are the purposes—because each prophecy (and each passage not originally intended by its human author to be prophetic, but now interpreted prophetically) has at least two: its purpose for being written, and its purpose for remaining in our Scriptures.
This is an important point to make. Very few Scriptural prophecies were given so that the remote descendants would know that the events of their later day had been foretold; in fact, every example of that kind that I know of says so more or less explicitly (by saying something like “Seal up the words of this prophecy until such-and-such”). Instead, most were given so that the people might be encouraged by impending deliverance (or chastened by impending judgment), either immediate or very soon. And those prophecies often used language of cosmic collapse—stars falling from heaven, the sun going out, and so forth—which we comparatively illiterate modern Christians are surprised to find in the Revelation to the Apostle John, but no reasonable interpreter disputes that such Old Testament prophecies of imminent deliverance and judgment were fulfilled. Those typical prophecies of doom—for God’s people or their oppressors—then shifted into prophecies of far-off final deliverance, restoration, and renewal—again, exactly what we find in the Revelation that closes the Canon.
But, if those prophecies (except for their eschatalogical bits) were fulfilled, why are they preserved in our Scriptures, when often the record of their fulfillment is not? Mainly, I think, they may be preserved for us so that we see that God has always kept his promises, so that our faith may be strong. (It would be unreasonable for God to ask us to trust him “on faith” if we had no evidence of his trustworthiness.) Secondly, they show us that these events of history—which some always want to portray as arbitrary, meaningless, and random—were really the acts of God, who prepared them in advance and told his people what was to come, and so these prophecies continue to glorify God. Additionally, some of the prophecies were preserved because they had (usually, as I said above, additional) fulfillments that were yet to come in the person of the Incarnate Word, “in whom all God’s promises are always ‘Yes!'”
But even with those, we need to be very careful not to assume that because they are preserved (and the Gospels and Epistles don’t explicitly say “this was to fulfill what was written by so-and-so the prophet”) that their fulfillment is still to come. The promises—and consistently, those passages of the writings of the prophets are more promises than prophecies—of consummation, yes. But why should God change his consistent practice of speaking imminently-relevant words through his prophets (or saying “seal this up until …” when the prophecies were for later generations but not that generation) when the Canon was closed?
And, even more importantly, we need to make sure that we don’t assume that any given promise or prophecy in the Bible is speaking to or about us. The reason, I think, that these are preserved in Scripture is for us to learn about God. (Not about our circumstances or (especially) ourselves.) We can—and should—learn what he is like and how he deals with his people. But just as it’s folly to interpret the prophetic proclamations of doom upon Nebuchenezzer’s Babylon apply to present-day Iraq, we ought not to assume that any other prophecy applies to our present day or (especially) our immediate future. God has spoken obscurely to his servants at times in the past, but he is not treating us as servants, but as children, and so speaks to us (when he does) plainly. If we have to resort to trying to match up headlines with lines of prophecy, we are clearly on the wrong trail.
So, to bring my tangents back to my original question: What is the purpose of prophecy? The same as that of all Scripture: to glorify God, and (at least one of) “teaching, rebuking, correcting, and training in righteousness.”