Hi @aliceintech - firstly, I would say Mexico is an amazing country and you're going to have an awesome time! I would say try and avoid using taxis at all in Mexico City - if you have to, make sure you pre-book. Otherwise, a trick I used to use when travelling alone in a taxi would be to get a person at my destination on the phone and talk to the taxi driver. They would give them the address and say something like "I'm expecting her arrival shortly".
With regards to the above story, just keep your wits about you as you would whenever and wherever you travel. Keep personal belongings on you, be wary of the kindness of strangers (they're not always bad, just don't be naïve). Don't keep large sums on money on you, and don't drink so much that you're not able to handle yourself. Make sure you have a mobile phone too.
The police in Mexico are pretty corrupt and not always the most reliable, so if possible, I would say carry the contact number of someone there that you trust at all times. That way, if you get in a difficult situation, they should be able to help you out. I'm not saying don't go to the police, but it helps to have a local friend on hand.
Enjoy your travels!