Did ancient Chinese states distinguish themselves with flags when China was divided? e.g. warring states/three kingdoms/northern and southern dynasties/five dynasties and ten kingdoms?
There was no real "national flag" prior to the Qing Dynasty, which makes sense, since the Qing came on round about the same time that the concept of a "national flag" really caught on.
More to your question, though... yes, flags/banners were certainly used for a variety of reasons for quite a bit of Chinese history. We have, for instance, Lady Wenji's Return to China, which is from the early 12th century Song Dynasty. Are those flags emblems of Lady Wenji's household? Are the battle standards? Tough to say for certain.
There's also considerable textual evidence of use of battle standards/flags in the centuries prior to that. For instance, the Xin Tang Shu tells of the conflict between the Uighur Khagan and one of his vassal Khans, of the Kyrghiz Tribe. The Khirghiz Khan, by the name of He-sa, ambushed his Uighur overlord's capital, Ordu-baliq, and started taunting his foe:
“Your luck has run out! I will take your golden tent, and in front of you tent I will race my horses and plant my flag. If you can oppose me, then come on! If you cannot, then away with you!”
(postscript on that incident: The Kirghiz totally won, but didn't actually plant any flags, but instead just burned the great gold tent and called it a day.)
Probably the oldest evidence of use of battle-standards is from the 4th c. BCE. In the Book of Mencius:
Wen-Tchang said: "May I venture to ask you a question: Which kind of thing should be used to call the keepers of the royal reserves?" Meng-Tseu said: "A burskin should be used; to call ordinary men, a plain red silk standard should be used; to call scholars, a standard on which two dragons are shown should be used; for the main administrators, a standard ornate with feathers of five colours hanging from the top of the lance should be used."
Here's a few other interesting flags - albeit from the Qing period: The Chinese Flag as depicted in a 1705 Russian flagbook, Chinese flag pre-1876, and the Flag of the Taiping Heavenly Kingdom.