He's feeling sick. He may feel sick because he can't poop, so won't eat, or he can't poop because he hasn't been eating. You need to take him to the vet because the cause of his digestive troubles could be any number of things. Vets aren't as expensive as people think they are - when my dog was sick the vet gave me a $12 prescription and a $30 charge for lab work.
Dogs are known to eat all weird kinds of things, which can, and do, cause bowel obstruction. When that happens, the dog typically goes off food. You will have to talk to a vet for tests and proper diagnosis because it could be something else.
If it were you .. or a small child .. What would YOU do? Me thinks, you'd take him/her to a doctor .. Why would your pet deserve any less? The only logical answer to your question is ... If there is something medically wrong .. Take him to the vet.