15 After these days we got ready and went up to Jerusalem. 16 And some of the disciples from Caesarea went with us, bringing us to the house of Mnason of Cyprus, an early disciple, with whom we should lodge. 17 When we had come to Jerusalem, the brothers received us gladly. 18 On the following day Paul went in with us to James, and all the elders were present. 19 After greeting them, he related one by one the things that God had done among the Gentiles through his ministry.
Upon their arrival to Jerusalem Paul meets with James and the elders of the church. Notice that the Apostles are not mentioned. They have since moved on and started evangelizing the world. Paul recants everything that has happened since his last visit in Acts 15. Especially how God has been moving among the Gentiles.
20 And when they heard it, they glorified God. And they said to him, “You see, brother, how many thousands there are among the Jews of those who have believed. They are all zealous for the law, 21 and they have been told about you that you teach all the Jews who are among the Gentiles to forsake Moses, telling them not to circumcise their children or walk according to our customs. 22 What then is to be done? They will certainly hear that you have come. 23 Do therefore what we tell you. We have four men who are under a vow; 24 take these men and purify yourself along with them and pay their expenses, so that they may shave their heads. Thus all will know that there is nothing in what they have been told about you, but that you yourself also live in observance of the law. 25 But as for the Gentiles who have believed, we have sent a letter with our judgment that they should abstain from what has been sacrificed to idols, and from blood, and from what has been strangled, and from sexual immorality.” 26 Then Paul took the men, and the next day he purified himself along with them and went into the temple, giving notice when the days of purification would be fulfilled and the offering presented for each one of them.
After Pauls report the church rejoiced in what God was doing among the Gentiles. But there is a problem.
Literally thousands of believers were believing a lie. A lie told by Judaizers (those that taught that you had to follow the Law of Moses and believe in Jesus in order to be saved). They were saying that Paul was teaching Jews outside of Jerusalem not to circumcise their children and to stop living according to the customs of Moses. Paul had never ever taught such things nor would he.
So they asked Paul if he would do something very public in order to set the record straight. So he, along with 4 other men, went to the temple to give notice when they had taken a vow of purification (a Jewish custom) and when they would be completing that vow. News of this would have spread throughout Jerusalem and silenced the liars who were teaching false doctrine.
Did Paul have to do this in order to be saved? No. He did this as a witness to others for Christ. Paul and James both knew that these rituals could not bring salvation.
27 When the seven days were almost completed, the Jews from Asia, seeing him in the temple, stirred up the whole crowd and laid hands on him, 28 crying out, “Men of Israel, help! This is the man who is teaching everyone everywhere against the people and the law and this place. Moreover, he even brought Greeks into the temple and has defiled this holy place.” 29 For they had previously seen Trophimus the Ephesian with him in the city, and they supposed that Paul had brought him into the temple. 30 Then all the city was stirred up, and the people ran together. They seized Paul and dragged him out of the temple, and at once the gates were shut.
31 And as they were seeking to kill him, word came to the tribune of the cohort that all Jerusalem was in confusion. 32 He at once took soldiers and centurions and ran down to them. And when they saw the tribune and the soldiers, they stopped beating Paul. 33 Then the tribune came up and arrested him and ordered him to be bound with two chains. He inquired who he was and what he had done. 34 Some in the crowd were shouting one thing, some another. And as he could not learn the facts because of the uproar, he ordered him to be brought into the barracks. 35 And when he came to the steps, he was actually carried by the soldiers because of the violence of the crowd, 36 for the mob of the people followed, crying out, “Away with him!” 37 As Paul was about to be brought into the barracks, he said to the tribune, “May I say something to you?” And he said, “Do you know Greek? 38 Are you not the Egyptian, then, who recently stirred up a revolt and led the four thousand men of the Assassins out into the wilderness?” 39 Paul replied, “I am a Jew, from Tarsus in Cilicia, a citizen of no obscure city. I beg you, permit me to speak to the people.” 40 And when he had given him permission, Paul, standing on the steps, motioned with his hand to the people. And when there was a great hush, he addressed them in the Hebrew language, saying:
The crowd follows and is upset that they cannot get to Paul. If it wasn't for the soldiers they would have torn him apart. Paul then asks the tribune, in the Greek language, if he could ask him a question. The tribune was surprised that he spoke greek and asked if he was the Egyptian who had created a terrorist group against them in the desert? Paul responds by saying emphatically that he is a Jew and a citizen of the city of Tarsus. He asks the tribune if he could speak to the crowd. The tribune allows this, why we don't know. Perhaps he thought that if Paul could speak to them he could straighten this out and save him a lot of paperwork.
English Standard Version (ESV)