The Two Witnesses will fill a crucial function in the end times and will contribute to the final overthrow of evil simply because a minimum of two witnesses are required for an accused person to be condemned. However, while we should be very aware of their role and function it is not a primary issue which requires us to get every detail correct. We will know soon enough.
In the mean time there are far more pressing warnings that we need to pay heed to in the here and now - The Wrath of God for example. Also the fact that Christians will be persecuted - possibly by the antichrist and his minions (See The Seven Seals) . Also considering the fact that the Lord devotes two chapters to the 'Two Babylons' makes it imperative that we ensure we at least grasp the broad outlines of the message that is being given us. In fact, make no mistake... these chapters are a crucial warning dealing as they do with specific targets of the wrath of God.
The Two Witnesses [Revelation 11: 3-13]
Although, apart from eleven verses in the book of Revelation, the "Two Witnesses" are not mentioned anywhere in the entire Bible, there is no question that these two individuals play a major role in the End Times. I use the term 'individuals' however, there is a considerable difference of opinion as to whether they are real life people and, if so, who they are. But more about that later. These are the relevant verses.
(3) "And I will grant authority to my two witnesses, and they will prophesy for twelve hundred and sixty days, clothed in sackcloth." (4) These are the two olive trees and the two lamp stands that stand before the Lord of the earth. (5) And if anyone wants to harm them, fire flows out of their mouth and devours their enemies; so if anyone wants to harm them, he must be killed in this way. (6) These have the power to shut up the sky, so that rain will not fall during the days of their prophesying; and they have power over the waters to turn them into blood, and to strike the earth with every plague, as often as they desire. (7) When they have finished their testimony, the beast that comes up out of the abyss will make war with them, and overcome them and kill them. (8) And their dead bodies will lie in the street of the great city which mystically is called Sodom and Egypt, where also their Lord was crucified.
(9) Those from the peoples and tribes and tongues and nations will look at their dead bodies for three and a half days, and will not permit their dead bodies to be laid in a tomb. (10) And those who dwell on the earth will rejoice over them and celebrate; and they will send gifts to one another, because these two prophets tormented those who dwell on the earth. (11) But after the three and a half days, the breath of life from God came into them, and they stood on their feet; and great fear fell upon those who were watching them. (12) And they heard a loud voice from heaven saying to them, "Come up here." Then they went up into heaven in the cloud, and their enemies watched them. (13) And in that hour there was a great earthquake, and a tenth of the city fell; seven thousand people were killed in the earthquake, and the rest were terrified and gave glory to the God of heaven. (Revelation 11:3-13 NASB)
In Summary the text tells us that the witnesses, clothed in sackcloth. will prophesy for about three and a half years. During this time they have the power to devour their enemies with fire from their mouths (V. 5), stop the rain by shutting the heavens, turn the waters into blood, and smite the earth with every plague as often as they want (V. 6). After their work is completed they will be killed (V. 7), their bodies will lie in the street for 3½ days (V. 9), after which they will be brought to life and, responding to a call from heaven, ascend there in a cloud (Vs. 11-12). In that hour an earthquake destroys a tenth of the city, kills thousands of people and terrifies the rest. (V. 13).
Their deaths opens the last and final chapter in the end time sequence of events. The very next verse says "The second woe is past; behold, the third woe is coming quickly". (Revelation 11:14 NASB)
Note: A "woe" is something that causes sorrow, grief, or misery. The first Five Trumpets are collectively known as "the first woe". The events of the Sixth Trumpet are called the "second woe", after which comes the rapture followed by the the Seven Bowls or third woe. The word bowls comes from the Greek phiale - a "broad, flat drinking vessel," of unknown origin.
Symbolic or Literal?
Many have claimed that the two witnesses are not real life people but symbolic, i.e they represent the church, Israel, or even some spiritual power. However this does not ring true for several reasons. A plain, non-esoteric reading of the text paints a straight forward picture of two humans with exceptional capabilities. Several of the verses also contain clear clues that they are referring to two people without however any hint as to who these individuals might be. Consider the following,
V. 3 - "And I will grant authority to my two witnesses"
Note: The Greek in verse 3 simply says "And I shall give to my two witnesses" without any indication of what is given. This is why the NASB puts the word 'authority' in italics and the KJV, that uses the word 'power', also puts it in italics. The CLV or Concordant Literal Version says "And I will be endowing My two witnesses".
Virtually everything in the New Testament is based on or an extension of the Old. In fact, more often than not, Hebrew prophecy is a repeating pattern (See Typology). Thus it is to the Old Testament that we must turn in order to understand the role and significance of the "two witnesses".
When someone's life was at stake, a minimum of two witnesses were required for an accused person to be condemned - a single witness was insufficient.
If anyone kills a person, the murderer shall be put to death at the evidence of witnesses, but no person shall be put to death on the testimony of one witness. (Numbers 35:30 NASB)
On the evidence of two witnesses or three witnesses, he who is to die shall be put to death; he shall not be put to death on the evidence of one witness. (Deuteronomy 17:6 NASB)
A single witness shall not rise up against a man on account of any iniquity or any sin which he has committed; on the evidence of two or three witnesses a matter shall be confirmed. (Deuteronomy 19:15 NASB)
Jesus upheld this rule when, in the New Testament He gave His disciples instructions regarding a wayward brother,
"If your brother sins, go and show him his fault in private; if he listens to you, you have won your brother. "But if he does not listen to you, take one or two more with you, so that by the mouth of two or three witnesses every fact may be confirmed. (Matthew 18:15-16 NASB) (Also see John 8:17-18)
Thus it seems more than likely that in the end times the Two Witnesses will fulfill a similar role pointing their fingers at either at Satan and his minions, an unbelieving and sinful world, or both. Regardless, it seems that at their testimony a guilty verdict is rendered, bringing swift judgment and sentencing.
V.4 "These are the two olive trees and the two lamp stands that stand before the Lord of the earth".
The imagery of the olive trees and lamp stands comes from a vision the prophet Zechariah had (Ch. 4) of two olive trees and two lamp stands which referred to Zerubbabel and Joshua who was High Priest at the time (Haggai 1:1). On return from captivity in Babylon these two men began to oversee the work of the house of the Lord. (Ezra 3:8)
V.5 "And if anyone wants to harm them, fire flows out of their mouth and devours their enemies"
This calls to mind Elijah who, in separate incidents, called down fire from heaven upon two companies of fifty soldiers each who were sent to arrest him. (The third company besought the prophet for their lives and were spared. 2 Kings 1). Fire from the Lord also consumed the men who had assembled together against Moses and Aaron (Numbers 16:35).
V. 6 "These have the power to shut up the sky, so that rain will not fall during the days of their prophesying; and they have power over the waters to turn them into blood, and to strike the earth with every plague, as often as they desire".
Like the prophet Elijah, the two witnesses also have power to shut up the heavens that it cannot rain. This is reminiscent of the judgment of God imposed on Israel when in answer to Elijah's prayer it did not rain for three and one-half years, curiously the same length of time as the ministry of these two witnesses in Revelation. Like Moses, they have power to turn water into blood and to bring plagues upon the earth as often as they will (cf. Exodus 7:17-19). Taking all the facts furnished, it is evident that these two witnesses have a combination of the greatest powers ever given prophets on earth, and this accounts for their ability to withstand their enemies for the entire period of 1,260 days. 
V. 7-9 "When they have finished their testimony, the beast that comes up out of the abyss will make war with them, and overcome them and kill them. And their dead bodies will lie in the street of the great city which mystically is called Sodom and Egypt, where also their Lord was crucified".
The entire church can not be destroyed by the beast, nor can their corpses lie in any single city.
V. 11-12 But after the three and a half days, the breath of life from God came into them, and they stood on their feet; and great fear fell upon those who were watching them. And they heard a loud voice from heaven saying to them, "Come up here." Then they went (Gk. anabaino) up into heaven in the cloud, and their enemies watched them.
When the voice from Heaven commanded the two witness to "come up here", they obeyed and ascended up to Heaven. The verb translated 'went' is used over 80 times in the NT. It is in the active voice indicating that the person concerned participated in the action. For example, Matthew 14:23 says "After He had sent the crowds away, He went (Gk. anabaino) up on the mountain by Himself to pray; and when it was evening, He was there alone".
In contrast, the verb used in 1 Thessalonians 4:17 translated as "snatched up" is in the passive voice - those that are 'snatched up' do not have to do anything. See The Rapture
Conclusion: the account of the life of the two witnesses preaching in Jerusalem, followed by their death, resurrection and ascension is more than likely to be literal, as is the account of the earthquake that follows and the seven thousand individuals (round number?) who die in it.
V.13 "And in that hour there was a great earthquake, and a tenth of the city fell; seven thousand people were killed in the earthquake, and the rest were terrified and gave glory to the God of heaven". (Revelation 11:13)
Which brings us to the whole question of ...
Largely based on the following reasons, many believe that the two witnesses will be Moses and Elijah who will return to earth for a short while.
1) Their feats mirror those performed by these two giants of the Old Testament,
2) They appeared with Jesus at the Transfiguration (Luke 9:28-36).
3) The archangel Michael disputed with the devil over the body of Moses (Jude 1: 9)
4) Based on a prophecy made in the book of Malachi (4:5)- "Behold, I am going to send you Elijah the prophet before the coming of the great and terrible day of the Lord", the Jews expected Elijah to literally and physically return before the Messiah did.
Note 1: The fact that Hebrews 9:27 says all men die once does not necessarily disqualify Moses because the author of Hebrews was making a point, not setting down an unassailable rule. Lazarus died twice - as did Dorcas who was raised from the dead by Paul (Acts 9).
Note 2: Malachi's prophecy was at least partially fulfilled by the coming of John the Baptist. See Matthew 17:10-13 and Mark 9:11-13.
Note 3: Contrary to popular belief neither Elijah nor Enoch went directly to heaven without dying. This idea came from a very superficial reading of Scripture and a misunderstanding of the word 'heaven' as it was used in Jewish thought.
See Did Elijah and/or Enoch Ascend to Heaven?
Let us bear in mind that the fact that God has not specified who the two witnesses will be probably means that He does not intend for us to identify them. They could be Moses and Elijah but, on the other hand, God is perfectly capable of enabling two other very ordinary people to do exactly what the prophets of old did.
When it is that the Two Witnesses make their appearance on the world stage has given rise to much debate.
During the Persecution of the Church Symbolized By The First Six Seals
The beast is given power to "speak great things" for forty two months or 1,260 days (Revelation 13:5) - exactly the same amount of time that the witnesses prophecy. This could mean that their mission could run concurrently with the antichrists's persecution of the church and the Gentiles 42 month trampling on the holy city. (Revelation 11:2-3 See Footnote).
When the Two Witnesses are taken up to heaven in a cloud there is a Great Earthquake on earth which destroys a tenth part of the city (Jerusalem?) and kills seven thousand people. One certainly can not be dogmatic about it, but there is a small possibility that this is the same earthquake that takes place at the opening of the sixth seal and the beginning of the tribulation of Seven Trumpets...
I looked when He broke the sixth seal, and there was a great earthquake; and the sun became black as sackcloth made of hair, and the whole moon became like blood; (Revelation 6:12 NASB)
However, there is far more evidence for the Two Witnesses making their appearance at a later time. That is...
Just Before The Seventh Trumpet That Heralds The Seven Bowls
Chapter 10 is the account of an angel that John saw descending from heaven and, with one foot on the sea and the other on land, proclaiming that there will be delay no longer (10:1-6).
Note: The division between chapters 10 and 11 may give the reader the impression that the content of each chapter is divorced from the other. This is far from the case. In reality, this particular vision begins in 10:1 and continues on through 11:14. It is interposed between the sounding of the sixth trumpet (the second woe), and the sounding of the seventh (the third woe) that heralds the final consummation and the time when that God reclaims his rightful rule over the earth. The ministry of the Two Witnesses was part of this vision. The final verses say
Then the seventh angel sounded; and there were loud voices in heaven, saying, "The kingdom of the world has become the kingdom of our Lord and of His Christ; and He will reign forever and ever." And the twenty-four elders, who sit on their thrones before God, fell on their faces and worshiped God, saying, "We give You thanks, O Lord God, the Almighty, who are and who were, because You have taken Your great power and have begun to reign. And the nations were enraged, and Your wrath came, and the time came for the dead to be judged, and the time to reward Your bond-servants the prophets and the saints and those who fear Your name, the small and the great, and to destroy those who destroy the earth. (Revelation 11:14-18 NASB) See The Seventh Trumpet
The point has been made that when the Two Witnesses of Revelation are killed at the end of their 1,260 days, the world rejoices and sends gifts to one another. In other words, the world isn't in that bad a shape with the post offices (and gift shops?) still functioning. However, 'sending gifts' may just be an expression used to describe the mood of the general population. The rejoicing a last hurrah before the end. However, placing the witnesses at this particular point in the chronology would mean that there would be a 3½ year period (the length of time the Two Witnesses are said to prophesy) between the trumpets of the 6th and 7th angels.
Chapters 12 and 13
Chapter 12 gives us a glimpse into the persecution of God's people under the dragon who wages war on the woman and her children. Chapter 13 continues this theme telling of the persecution of the saints by the beasts who will be empowered by the dragon.
See A Dragon and Two Beasts
In chapter 13, John tells us of two beasts he saw. The first emerged from the sea and described the rise of the final world empire (Vs. 1-9). However, the second half of the chapter (Vs. 10-18) describes another beast that emerged from the earth which can only be the final world leader. Although, what John saw is described between the Sixth and Seventh Trumpets, it is not when these events occur.
Also See The Six Part Article The End of The Age
Not only does the imagery and symbolism of Revelation describe the horrendous conditions of the last days, but tells us in what order they will occur. In summary, the first Six Seals unfold one after the other. The 'Four Horsemen of The Apocalypse" (The first four seals) symbolize the persecution of the church with much blood being shed, which will be the last straw bringing an end to God's patience. The opening of the Seventh Seal will introduce the series of Seven Trumpets. The first six are the 'Great Tribulation', which Jesus said would be unparalleled in the history of our planet. The blowing of the Seventh Trumpet will herald Jesus appearing before the Face of God for us, and what we call the "rapture". This will be closely followed by the Seven Bowls when He will, as the prophet Zephaniah said, cut man off from the face of the earth (Zephaniah 1:2-3)
As said by David Guzik in his commentary on Revelation
When the city of Jerusalem was destroyed in 70 A.D. by the Romans destroyed the city so completely that the foundations of the old temple are not easily found. Most have long assumed that the Dome of the Rock shrine stands on the place of the old temple. But new research gives some evidence that the temple may have stood to the north where the Dome of the Rock shrine is today, and that if the temple were to be rebuilt at its old place, the Dome of the Rock shrine would be in its outer courts. If this is the case (and the research is by no means settled), then it would explain why the angel told John leave out the court which is outside the temple, and do not measure it, for it has been given to the Gentiles.
 John F. Walvoord. The Two Witnesses And The Seventh Trumpet.