I looked through my girlfriend's phone without her knowing and saw that she's texting other guys. What should I do?
I wish you would have told us more about the nature of these messages. But since you didn't, will cover all possibilities:
If you found texts that indicate she's cheating (i.e., "Last night was amazing. I didn't even know I was capable of multiple orgasms!") or imply an intent to cheat, confront her about your findings. Be aware that you will be attacked for snooping. And you shouldn't be snooping. But, she also shouldn't be cheating. Chances are, this relationship was unhealthy to begin with.
If the texts are just friendly, ask yourself if confronting her is worth exposing yourself as insecure (which you are, if you're looking their your girlfriend's phone without her knowledge).
Respect her privacy and set some boundaries. If you're unable to keep yourself from rifling through her messages, ask yourself, why? Why are you unable to trust her? Is she doing something to make you feel paranoid? Or is there something in you that's causing this?
Talk to her about your feelings but without mentioning that you've gone through her phone. Unless you want to entertain the possibility of her leaving you.