To begin, we need to remember something very basic, that is nevertheless taken for granted by modern readers: the ancient world didn't have audio recording. In the specific case of Acts 2, Peter's speech is portrayed as an impromptu reaction to accusations of drunkenness. Short of believing God himself told the author of Acts exactly what Peter said, it is simply impossible to expect this speech (or any of the others in the book) to be a verbatim record of what Peter said.
That said, the historical criticism of the speeches in Acts largely depend on a close examination of the vocabulary, the grammar, and the style used in the speeches as compared to the author's own narration. This is because the author and the speakers would have their own distinguishable speech patterns.
If there is virtually no difference between the narration and the speeches in terms of vocabulary, grammar, and style, it would be a sign that the speeches were worded and shaped by the author. This would not necessarily mean the speeches are total fabrication of the author. It could easily be that the speeches were simply summarized, condensed, or reshaped to fit into his narrative.
But if there are clear differences, it could be a substantial sign that the speeches came from an older source. (Assuming the author didn't consciously alter his writing style in the speeches, which some have suggested.)
The speeches in Acts do, in fact, contain some peculiar features that indicate the author was not pulling the speeches out of thin air to suit his narrative or his theology.
For example, Luke-Acts uses the Greek word for 'heaven' (ουρανος) 63 times, give or take a few depending on manuscript tradition. However, the author uses the word in the plural form only five times in Luke (10.20; 11.2; 12.33; 18.22; 21.26) and only two times in Acts (2.33; 7.56). This is unusual for the author, since he actually changed the 'heavens' to the singular 'heaven' in some of his parallels with Mark and Matthew (Luke 3.21-22; 6.23; 11.13; 15.7). All seven instances of the plural 'heavens' in Luke-Acts occur in speech from Jews (Jesus, Peter, and Stephen), not from the author's narration.
Taking note of this peculiarity, Zwiep examines the phrase 'ἀνέβη εἰς τοὺς οὐρανούς' in Acts 2.34 and suggests Peter's speech is pre-Lukan in origin, saying,
Luke never uses ἀναβαίνω in connection with the ascension and he has a
pronounced preference for the singular οὐρανός instead of the plural
οὐρανοί. Luke is likely to have taken up this phrase from his source,
presumably from a Jewish-Palestinian milieu. Since Luke did not
assimilate the words to his own idiom, we may assume that he uses the
While discussing the apocryphal Didache, Robinson notes that the book's 'prayers and thanksgivings are full of archaic terminology'. He specifically notes how the Didache calls Jesus the 'servant' (παῖς) of God, pointing us back to Peter's speeches in Acts 3 and 4. Robinson suggests such vocabulary represents 'the earliest Christian liturgical language', bringing us back to early material.2
In the same line of thought, Green writes:
The doctrine in these sermons is quite unlike that of Luke himself. He
certainly did not think of Jesus as simply 'a man approved of God',
'the prophet', 'the righteous one', 'the prince (or "originator") of
life'. His own theology did not expect 'times of refreshing from the
presence of the Lord that he may send the Christ appointed for you';
his eschatology was of a different order. Long ago Harnack was greatly
impressed by the antiquity of the title 'servant of God' used of Jesus
in the speeches of Acts but nowhere else in Luke, and Cullman and
Jeremias agree with him. The attempt by Wilckens to evade this point
has been capably refuted by Dupont. Certainly the appearance of a
'different' theology in the Acts sermons need not necessarily mean
that it is ancient; but when taken with the Aramaisms and the very
Jewish nature of the doctrinal formulations concerned, the presumption
is strong that we have here something very old.3
Green goes on to say
we may with some confidence accept the sermons in Acts, not indeed as
a transcript of what was said, nor even as a summary of the addresses
(so thoroughly has Luke conformed them to his own style), but as a
reliable sample of the way in which the early Christians set about
convincing first the Jews of Jerusalem, then proselytes like
Cornelius, then Diaspora Jews and finally Gentiles from varying
backgrounds, of the truth of the Christian proclamation.4
This seems to be the general perspective on speeches in ancient Greco-Roman historiographies. Based on the evidence of vocabulary and style, the speech in Acts 2, while likely not a verbatim record of Peter's own words, may rest on a core mode of thought and set of language used by Peter and/or his fellow Jews, and was intended by the author to accurately represent the type of thing he would have said in that time and place and situation.
1 Arie W. Zwiep. The Ascension of the Messiah in Lukan Christology, p.155-156.
2 John A.T. Robinson. Redating the New Testament.
3 Michael Green. Evangelism in the Early Church, p.104.
4 Ibid., p.105.