Q is the name used by scholars to describe a lost source on Jesus' teachings.It can be reconstructed from the gospels of Matthew and Luke, which are based on two earlier sources: the gospel of Mark and Q. Stated differently, Q is by definition the material that Luke and Matthew have in common but is not dependent on Mark.
It is not entirely clear whether Q's sayings are really Jesus'. As a rule of the thumb, we may assume that an early date of composition indicates a high reliability and vice versa. Now, there are many sayings referring to the coming of the Son of Man and the establishment of the Kingdom of God, and these sayings often imply that Jesus' disciples will still be alive (e.g., Luke 12.54-55 and 16.16 = Matthew 16.2-3 and 11.12). This points to an earlier date. Another indication can be found in the "woe to" sayings. These are addressed to Galilean cities and Pharisees, suggesting that the author of Q was especially interested in the dialogue - or an exchange of invectives - with the Jews (cf. Luke 12.11-12). Another argument for an early date is the story of the Roman centurion. This can easier be placed in the period of friendly relations between the Jews and the Romans before 41 than afterwards.
Summing up: there is some circumstantial evidence for an early date of Q. This suggests that the sayings go back to Jesus - but it is nothing more than a suggestion. It is impossible to establish a "community" in which Q was the authoritative text, and no two scholars agree on this subject.
The two evangelists have used the subject matter of Q differently. Luke seems to render the sayings more or less in the same order as he found them; Matthew has used them to compose speeches (e.g. the Sermon on the Mount). It is believed that Matthew's version stays closer to the words of the original document. The table gives an overview; the wording is Matthew's and is derived from the New King James translation.