TL;DR Many people planning to go on fasting (and even those already are on it) want to know whether coffee and other forms of caffeine will influence it. Experts seem to say different things - some think caffeine won't break the fast while others say better to steer clear. But our conclusion? It's okay to get your caffeine fix while fasting... as long as they don't have any add-ons!
Caffeine and fasting are controversial in some circles. Is it truly fasting if you have coffee or other liquids during your time of abstaining from eating? Some people say to be pure fast, one must drink only water and eat nothing. Others maintain that having coffee and/or other liquids is healthier and ensures you don’t become dehydrated.
FASTING FOR HEALTH
Intermittent fasting (IF) has become not just a global health and fitness trend, but a way of life.
Intermittent fasting is an eating pattern where you cycle between periods of eating and fasting.
It does not say anything about which foods to eat, but rather when you should eat them.
Doing IF is not just for losing weight, but also for better metabolism, improving medical conditions like diabetes, more optimal brain activity, a stronger immune system, and basically living longer. [2, 3, 4]
Dr. Joseph Mercola, an alternative medicine proponent, osteopathic physician, and the writer from Mercola.com explains the many benefits of fasting. He writes: 
Fasting, it turns out, has a number of health benefits that most people seek: from improved cardiovascular health and reduced cancer risk, to gene repair and longevity. It’s true that severe calorie restriction promotes both weight loss and longevity in animal models, but this kind of “starvation diet” is not a very appealing strategy for most people. However, newer research shows that you can get most if not all of the same benefits of severe calorie restriction through intermittent fasting, i.e. an eating schedule where you feast on some days, and dramatically cut calories on others. This effectively mimics the eating habits of our ancestors, who did not have access to grocery stores or food around the clock. They would cycle through periods of feast and famine …
Fasting also promotes a healthier body in many different ways, including:
Detoxification. Not eating for a while allows our bodies to clean out stuff in the digestive and lymphatic systems. Also, toxins we take in are stored in our body fat, and when we fast our body burns this fat, cleaning out more toxins.
Reduced blood sugar. Fasting increases the body’s breaking down of glucose. When glucose is metabolized, the process of ketosis begins, when the body breaks down fats that release energy.
Fasting rests the digestive system, which may be especially helpful for people with ulcers because the body produces fewer acids used to digest food.
Inflammatory relief. It’s possible that when people suffering from inflammatory diseases, rheumatoid arthritis and allergies, for example, if they take in fewer foods that cause inflammation they get some relief.
Lowered blood sugar. Fasting reduces blood sugar and gives the pancreas a rest. The pancreas is involved in the production of insulin. Hyper-production of insulin can burn out the pancreas, after which insulin production may crash. That results in too much sugar being left in the blood.
CAFFEINE AND FASTING
Whatever your reason for fasting, you may find it leads to a healthier physical or spiritual state. Some people even fast or starve themselves to make political statements.
But in the realm of having your daily caffeine fix, here’s the bigger question:
Can you have your caffeine fix while intermittent fasting?
What if you have blood work first thing in the morning and you need your first cup of java at the same time?
Experts weigh in on this. Some say caffeine breaks the fast, while others say it’s okay to have your caffeine fix while fasting:
In an article on Mercola.com, health and fitness guru Steve Kamb says it’s OK to drink any zero-calorie beverages during an intermittent fasting routine. 
“Zero-calorie beverages are okay. As previously stated, I drink green tea in the morning for my caffeine kick while writing. If you want to drink water, black coffee, or tea during your fasting period, that’s okay. Remember, don’t overthink it – keep things simple! Track your results, listen to your body.”
According to Dr. Akil Palanisamy, physician and author of The Paleovedic Diet:
"Autophagy is the self-cleaning process by which the body's cells break down and recycle damaged proteins and components. This is activated by intermittent fasting, but anything other than water (even black coffee) disrupts it to some extent.” 
Rhonda Patrick, a Ph.D in biomedical science and expert on nutritional health, says that drinking black coffee, green tea and vitamin supplements break the fast.
Dr. Josh Axe, D.N.M., C.N.S., D.C., of DrAxe.com and best-selling author of “Eat Dirt” thinks that “tea and coffee are fine to consume as long as you don't add any milk or sweeteners.” He explains on his blog:
"If you’re on a time-restricted fast and you’re in no-eating hours, it’s best to stick to no- or low-calorie drinks like water, coffee (with no milk) and tea. If you’re on an alternate day diet or something similar, even during low calorie hours, you can technically drink whatever you’d like — but remember, this will count against your calories. Would you rather spend 100 calories on an apple or a glass of milk? It’s your call.” 
Fasting for blood work. Mayo Clinic Medical Laboratories allows drinking coffee up to two hours before some tests: 
Is having black coffee fasting? Doctors keep telling patients it is all right to have black coffee before fasting blood work (fasting sugar, fasting lipid panel).
It depends to some extent on what test is being performed, but for many tests that require fasting, intake of non-carbohydrate containing liquids a few hours before testing will not impact results. We have worked here to make 1 standard definition of “fasting” that encompasses most test requirements. We allow clear liquids (water, black coffee) up until 2 hours before a test or procedure. The definition of fasting should be clarified for all procedures in your institution if possible.
It depends to some extent on what test is being performed, but for many tests that require fasting, intake of non-carbohydrate containing liquids a few hours before testing will not impact results.
We have worked here to make 1 standard definition of “fasting” that encompasses most test requirements. We allow clear liquids (water, black coffee) up until 2 hours before a test or procedure. The definition of fasting should be clarified for all procedures in your institution if possible.
It seems in all but the most extreme fasts, coffee and tea are allowed, though sugar-containing and caffeinated drinks like sodas and fruit juices may be considered breaking a fast.
That said, if you fast for a long time (again we emphasize you should fast for lengthy periods only with a doctor’s guidance) pure fruit juices may be one way to take in some calories and needed carbohydrates.
There are sources of caffeine other than coffee, tea and soda. Viter Energy Mints contain ingredients that might affect blood test results and that might nullify a spiritual fast. However, No-Doz and some types of non-steroidal anti-inflammatory drugs contain caffeine, but again, check with your doctor before have blood drawn.
Erectile dysfunction. In combination, those are two of the ugliest words known to man. But can caffeine help you get it up?
Science hasn't found the definitive answer to this question, but one study concluded that fewer men who consume caffeine have problems performing. The study said:
Caffeine intake reduced the odds of prevalent ED, especially an intake equivalent to approximately 2-3 daily cups of coffee (170-375 mg/day). This reduction was also observed among overweight/obese and hypertensive, but not among diabetic men. Yet, these associations are warranted to be investigated in prospective studies