Many problems can cause bad breath in a dog. The most common cause is dental problems and you can usually spot these as you can see tartar on the teeth and possibly red gums and darkened teeth. Kidney problems or diabetes can also cause bad breath as can a stomach upset or your dog licking his anal glands which are seeping due to being overfull, though you usually can smell this cause at both ends of your dog.
First check your dog's mouth, if it looks like it is his teeth, your vet can take care of this problem. I'd try adding some regular unflavored yogurt (not fat-free) to your dog's food for a week or so and see if that doesn't help solve the problem
Many things can cause gas. It is believed that dog foods containing soy products and other food allergies contribute to gas problems as well. Sometimes a change in diet will help the problem. Smaller meals spread out can help and taking your dog for walks after meals cuts down on gas. Adding good bacteria as I mentioned above with the yogurt can help, but there are products, such as Prozyme, that can be purchased at your pet store to aid digestion and cut down on gas.
Here is a site that discusses the problem:
If you have switched foods recently or added a new treat, you may be looking at an allergy issue as well. this can cause gas and exessive licking though usually skin issues are seen with allergies. You may also give your dog Benadryl up to 2mg per pound every 8 hours if you feel allergies may be to blame. Here are some sites on allergies.
Hope this helps.