Notice the Sharp sign immediately in front of the note F ?
The pattern of tones and semitones, tells us that the G Major scale, contains the note, F Sharp.
The last three chords that you learned ( G major, D7, and C Major ) are the most common chords used when playing music in the key of G Major
From looking at the G major scale, you can see that when playing music in the key of G major, every F note, will have to be played as, F Sharp ( the black key, immediately to the right of the note G )
To avoid having to put a sharp sign in front of every F note, in music written in the key of G major, a sharp sign is placed at the beginning of the music, instead.
We just have to remember to play F sharp, whenever the note, F appears.
The sharp sign is placed on the top line ( the F note position ) on the Treble staff, and on the fourth line up from the bottom ( again, the F note position ) on the Bass staff.
There is more than one F note on each staff, but only one sharp sign is used on each staff. It still applies to any F note in the music.
This is called the Key Signature. In other words, it is telling us that the music is written in the key of G Major.