Hello, and welcome.
I'm sorry your cat is experiencing these problems.
The throwing up of white foam could be caused by excess acid or acid reflux, and his bad breath could be related to stomach upset. For the moment, you can give him 1/4 of a 10mg. Pepcid AC (Famotidine) tablet every 12 hours; this will help control excess acid and quell the nausea he's feeling.
Have you noticed if he urinated within the past 24 hours? Is he going to the box frequently, but unable to 'produce' or just a few drops come out? If so, he may have a urinary blockage, which is a medical emergency in cats. If you've seen him urinate normally, we don't have to worry about this.
Bad breath can also be caused by an oral problem like an abscessed tooth, gum infection or stomach upset; however, if his breath smells like nail polish remover, he could have ketoacidosis, a by-product of diabetes. This is a very serious condition.
He may be walking slowly because his stomach or bladder hurts or he may be developing some arthritis.
Due to his symptoms and it sounds like he's in pain, it would be best to have your kitty evaluated in person by a vet, asap. If your vet doesn't have emergency hours, try to bring him to the nearest ER vet clinic. If you're not sure where an ER is, in your area, check this site and plug in your zipcode:
I hope all will be well with your furry boy! Please let me know how he's doing and what the vet's findings are. Thanks!
Please be so kind as to rate my answer with positive feedback, as that is the only way I receive recognition from the site for my assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply' for clarification or additional information, if needed.