You stae that you broke up with your ex. The password is to her personal account. You could definitely get in trouble if she accuses you of harrassmentor invasion of privacy. throw away the password, and have a discreet friend get a note to her to change it ASAP.
When you were going out with your ex and she gave you permission to access her account that would be considered a permissive entrance. Since you have since broken up, you would have to assume that your permission to access the account was revoked. Accessing her email since you broke up could be considered, among other things, criminal trespass and an invasion of privacy. It would be prudent to stop accessing the email.
You may have issues with the Federal Computer Fraud and Abuse Act and even some state laws if you access someone else's email without authorization. You may also may face a claim from the service provider. Accessing someone else's email may violate their terms and conditions. If you have an account with that company, they can remove you as well.
Do not do it, the risk is not worth it.
[This communication is intended as general information and not specific legal advice, and this communication does not create an attorney-client relationship.]