In chapter 1, Paul had just finished giving his account of his conversion. He is trying to explain to the Galatians that nobody taught him his gospel, because it was revealed to him directly from Jesus Christ.
"Then fourteen years after I went up again to Jerusalem with Barnabas, and took Titus with me also."
But neither Titus, who was with me, being a Greek, was compelled to be circumcised:
And that because of false brethren unawares brought in, who came in privily to spy out our liberty which we have in Christ Jesus, that they might bring us into bondage:
To whom we gave place by subjection, no, not for an hour; that the truth of the gospel might continue with you." Galatians 2:1-4
Paul says there were false brothers that came in secretly to dispute with Paul about circumcision. It seems he believed that these men were Jews pretending to be Christian so that they could argue about circumcision. This next part is going to be confusing. I'm going to stop using the KJV for a bit and make a literal translation with the Greek as a reference:
"of moreover those esteemed (δοκέω) to be something (whatsoever formerly they were not to me makes a difference; surface the God of mankind not does accept) to me indeed those esteemed (δοκέω) nothing added" Galatians 2:6
ἀπὸ δὲ τῶν δοκούντων εἶναί τι ὁποῖοί ποτε ἦσαν οὐδέν μοι διαφέρει πρόσωπον ὁ θεὸς ἀνθρώπου οὐ λαμβάνει ἐμοὶ γὰρ οἱ δοκοῦντες οὐδὲν προσανέθεντο
Paul is now talking about a different group of people. These "esteemed" are not the same as the false brothers. Any time the words "reputation" or "seemed" appears in the KJV, it is from the Greek δοκέω which means "to seem" or "to be of an opinion". Okay, back to the KJV but I'm going to move a parenthesis and the last part will be literal:
But contrariwise, when they saw that the gospel of the uncircumcision was committed unto me (as the gospel of the circumcision was unto Peter;
For he that wrought effectually in Peter to the apostleship of the circumcision, the same was mighty in me toward the Gentiles:)
and having known the grace the having been given to me Jacob and Cephas and John those esteemed pillars to be right hands they gave to me and Barnabas of fellowship that we to the nations they moreover to the circumcised
καὶ γνόντες τὴν χάριν τὴν δοθεῖσάν μοι, Ἰάκωβος καὶ Κηφᾶς καὶ Ἰωάνης, οἱ δοκοῦντες στύλοι εἶναι, δεξιὰς ἔδωκαν ἐμοὶ καὶ Βαρνάβᾳ κοινωνίας, ἵνα ἡμεῖς εἰς τὰ ἔθνη, αὐτοὶ δὲ εἰς τὴν περιτομήν
So let's put that all together, but take out the parenthesis:
of moreover those esteemed (δοκέω) to be something (whatsoever formerly they were not to me makes a difference; surface the God of mankind not does accept) to me indeed those esteemed (δοκέω) nothing added
But contrariwise, when they saw that the gospel of the uncircumcision was committed unto me
and having known the grace the having been given to me, Jacob and Cephas and John (those esteemed pillars to be) right hands they gave to me and Barnabas of fellowship that we to the nations they moreover to the circumcised
Only they would that we should remember the poor; the same which I also was forward to do." Galatians 2:1-10
So the esteemed are Jacob, Peter, and John. Paul says these men added nothing to his gospel, because he had received his gospel by revelation of Jesus Christ. He then goes on to tell a story about how he boldly stood up to Peter in front of everyone:
But when Peter was come to Antioch, I withstood him to the face, because he was to be blamed.
For before that certain came from James, he did eat with the Gentiles: but when they were come, he withdrew and separated himself, fearing them which were of the circumcision.
And the other Jews dissembled likewise with him; insomuch that Barnabas also was carried away with their dissimulation.
But when I saw that they walked not uprightly according to the truth of the gospel, I said unto Peter before them all, If thou, being a Jew, livest after the manner of Gentiles, and not as do the Jews, why compellest thou the Gentiles to live as do the Jews?" Galatians 2:11
I find it interesting that this same event is said to have happened in Acts. Except in the Acts account, Peter is in Jerusalem and the exact opposite happens:
"And the apostles and brethren that were in Judaea heard that the Gentiles had also received the word of God.
And when Peter was come up to Jerusalem, they that were of the circumcision contended with him,
Saying, Thou wentest in to men uncircumcised, and didst eat with them.
But Peter rehearsed the matter from the beginning, and expounded it by order unto them, saying,
I was in the city of Joppa praying: and in a trance I saw a vision, A certain vessel descend, as it had been a great sheet, let down from heaven by four corners; and it came even to me....
....Then remembered I the word of the Lord, how that he said, John indeed baptized with water; but ye shall be baptized with the Holy Ghost.
Forasmuch then as God gave them the like gift as he did unto us, who believed on the Lord Jesus Christ; what was I, that I could withstand God?
When they heard these things, they held their peace, and glorified God, saying, Then hath God also to the Gentiles granted repentance unto life." Acts 11:1-18
It's also interesting that Paul says everyone agreed that Peter should go to the circumcised, and Paul to the uncircumcised. In Acts, Peter says:
"And when there had been much disputing, Peter rose up, and said unto them, Men and brethren, ye know how that a good while ago God made choice among us, that the Gentiles by my mouth should hear the word of the gospel, and believe." Acts 15:7
Paul seems upset with Peter about something. It also seems like Paul has read Acts and he's not too happy with what it said. He tells many stories that Acts records in the first two chapters of Galatians, but he tells them with his own spin on things.
Scholars are mixed about whether Paul wrote Galatians before the Jerusalem Council or afterwards. I think it's more reasonable to say this was after Acts 15, because Paul isn't too happy with Barnabas and they had split up shortly after the Jerusalem Council. Paul and Barnabas had a disagreement and Paul could not forgive Mark for leaving them in Pamphylia, so Paul decided to separate from them:
And some days after Paul said unto Barnabas, Let us go again and visit our brethren in every city where we have preached the word of the Lord, and see how they do.
And Barnabas determined to take with them John, whose surname was Mark.
But Paul thought not good to take him with them, who departed from them from Pamphylia, and went not with them to the work.
And the contention was so sharp between them, that they departed asunder one from the other: and so Barnabas took Mark, and sailed unto Cyprus;
And Paul chose Silas, and departed, being recommended by the brethren unto the grace of God.
And he went through Syria and Cilicia, confirming the churches." Acts 15:36-41
Paul is also trying to distance himself from the Apostles that Yeshua chose, and it's probably because he doesn't want the Galatians to be persuaded by the gospel they taught. As was stated before, Paul's trying to explain that his gospel came directly from Jesus Christ:
"But I certify you, brethren, that the gospel which was preached of me is not after man.
For I neither received it of man, neither was I taught it, but by the revelation of Jesus Christ." Galatians 1:11-12
Conclusion:
I'm going to say Paul is lying about Peter. He doesn't want the Galatians to think that any other gospel than the one he is preaching is valid, so he brings into question the authority of Peter and then tells a story to confirm that Peter has lost his way. So I guess it's up to you. Do you trust the man that never spent a day with Yeshua and came in his own name (John 5:43), or do you trust that the Messiah chose his apostles because he knew they would deliver his message?
"And ye also shall bear witness, because ye have been with me from the beginning." John 15:27