Can taking fastin (phentermine) cause severe headaches?

Yes. It's not common, but it happens, and it's probably not a good medicine for you. Most people have no problems with it, but some are very sensitive, and have spikes in blood pressure or other severe symptoms, and they shouldn't take it without discuss first with their doctor.
Yes. Fasting would cause hypoglycemia which in turn would commonly cause severe headaches.