Final answer:
Mexicans have lived under the flag of the Spanish Empire before Mexico's independence, the flag of the Mexican Empire and the Mexican Republic after independence, and the Texas Republic's flag until the Mexican-American War ended with the Treaty of Guadalupe Hidalgo, ceding territories to the United States.
Step-by-step explanation:
The flags under which Mexicans have lived are primarily related to different periods in Mexico's history. First was the flag of the Spanish Empire, representing the colonial period before Mexico's independence. Then came the flag of the Mexican Empire and the subsequent Mexican Republic following the successful War of Independence, symbolized by the Plan de Iguala and the Army of the Three Guarantees. Lastly, as a result of the Texas Revolution, the Texas Republic flag represented those territories until they were annexed by the United States.
During the Mexican-American War, Mexico was defending their flag and territory until the Treaty of Guadalupe Hidalgo was signed, where Mexico ceded more than half of its territory, leading to the current Mexican flag and the United States flag representing the people in these regions.