Flags are used to communicate the track status to the drivers. They can show danger, end of the session and no overtaking amongst other things.
Blue:
Held: Warning - competitor close behind
Waved: Warning – competitor trying to overtake
Yellow:
Held: Danger ahead, no overtaking
Waved: Danger directly ahead, no overtaking
Double Waved: Be prepared to stop, danger ahead, track may be blocked
Green Flag:
Track clear / open
Red and Yellow Striped Flag:
Slippery track ahead (this may be rain or oil on the track ahead)
Red Flag:
Race, qualifying or practice stopped immediately. Return to pits slowly
White Flag:
Slow moving vehicle ahead (this may be a car returning to the pits or a safety car or ambulance)
Black and White Flag (divided diagonally - held up with competitors number):
Caution for unsportsmanlike behaviour
Black Flag (held up with competitors number):
Disqualification of driver. Return immediately to the pits
Black Flag with Orange Spot (held up with competitors number):
Dangerous fault with your car. Return immediately to the pits
Chequered Flag:
End of race, qualifying or practice