Flags are pieces of fabric with different dimensions usually rectangular. Flags have different functions like a representation of the countries; most of the nations around the world have flags with colors and symbols that represent the culture of the country or sometimes a significant event. Flags were used historically for signaling like the white flag which signals surrender, the pirates' flags which were used to indicate the pirates' ships.
Historically, no-one knows for sure when flags were used for the first time, but it is believed that it was used in warfare in ancient Egypt or Assyria. Historians believe that the modern flags were invented in the Indian subcontinent or China.