First, have you been making any backups at all to an external device?
Secondly, do you still have the file entitled "Install OS X Yosemite" somewhere on your Mac? (This might not be necessary, as you'll see below).
Third, what third party software are you using? And, are such programs up to date in terms of compatibility with OS 10.9.5?
Assuming you have been making backups (unless you can afford to lose everything on your internal drive, and also assuming the backup is via Time Machine), you actually can start "from the beginning" to get a clean system. There is a hidden partition on your Mac called "Recovery HD". This link describes how to boot to it, and what it has/can do:
https://support.apple.com/en-us/HT201314
So, what you could do is boot to that partition. Then, run Disk Utility from there to verify that the drive is OK. Then, Erase, Format, and if necessary, Partition the internal drive. Next, you would choose the option "Install OS X". What I am unclear about is whether it would install anything less than OS 10.10.5 (that is, 10.10, 10.10.1, 10.10.2, 10.10.3, or 10.10.4. If it does install anything less than 10.10.5, don't worry, you'll be able to get to that point easily). (Whenever I need to do a Recovery, I go through a different process, and I know what exact OS I will arrive at).
Once that is done, you should be able to reboot your Mac to the "cleanly installed" OS. Your gmail password issues should be gone. If the OS is not 10.10.5, you can get to that by downloading the OS 10.10.5 Combo Updater from here:
https://support.apple.com/kb/DL1832?locale=en_US
You could then launch that, and you'll be at OS 10.10.5.
Finally, ff you want to recover all the non-Apple stuff from a backup, you can use Migration Assistant for that. Given that a gmail account is via a browser, the password is something you enter yourself (in your case, not stored anywhere, although that should make no difference).
After all that, can you use a different EMail "service", instead of gmail? Yahoo is one example, as is hotmail. That would be the ideal time to set up such an account, via your browser.
One other thing is that I recommend you invest in a good Password Management program. 1Password is excellent for that, and it costs only $24.99. You can get it via this link:
https://agilebits.com/store
I have it, and it is rock solid. And, it has had so many positive reviews (and also been around a long, long time). It provides an excellent warehouse for your passwords. I also have a gmail account, and my password is kept there. Definitely can be a life saver!