What is the function of this transistor?
The other answers are so incorrect.Q2 is what is called VAS, or transimpedance stage; this is an age old idea used in many audio amplifiers today. The purpose is to convert current to voltage; Q1 converts voltage to current, but audio amps are voltage amplifiers, so current has to be convert back to voltage, and then buffered. Q1 also inverts the phase and Q2 puts it back to normal. 

First schematics is wrong, because it has too much of a gain (10000 easily), without negative feedback, that drops the gain to the normal values , &lt;100.

EDIT: I thought a bit, and kinda understand where LvW is coming from. First of all yes, you can consider it as a DC shifter (coupled with R2), as it moves Vcc at the collector down to ground level and amplifies, with inversion. But that is not all. Anyway, his explanation is not as wrong as it is incomplete and it uses little too academical language. Besides OP changed the question in a subtle which caused a lot of confusion. I apologize if if was too harsh.