Having traveled solo quite a lot (and being a woman), I'll offer some tips which you may already be doing.
Dress and carry your belongings in a style that will blend in with locals so you don't stand out as a tourist, especially an American tourist. As in any big city, it's not rude to avoid eye contact with strangers, it's quite normal.
If someone asks you where you are going, don't give them a straight answer. "Oh, well, I have a lot of places on my list for today!" is a useful response. Naturally there will be situations where you need to ask directions, and if so try to ask a woman or a family.
On the train, if you leave your seat to use the lavatory or something, take all of your bags with you.
If you want to visit bars/pubs, it's better to find a "pub crawl" walking tour to go as a group than to go alone. Overall, trust your instincts. If a situation feels dicey, better to turn around and leave than to risk it.
All of that said, the vast majority of people you'll encounter are perfectly nice and trustworthy. You may meet another solo tourist and enjoy hanging out together for a day. I've even shared a hotel room with a stranger on occasion, with no ill effects-- one of those shares turned into a years-long friendship!