Is Mexico city a capital and a city?

Yes , Mexico city is both a city and the capital of Mexico .