Scientists have been doing research on a coffee-cancer link for a very long time. Meta-studies looking at all the scientific literature up to date have clearly shown that not only there is no association between coffee-drinking and cancer, but there is actually a mild inverse correlation between drinking coffee and some type of cancer. In other words, not only does coffee not give you cancer, but it may mildly protect you from some types of cancer, such as breast and liver cancer.
Coffee does, however, contain some substances that can be harmful in high concentrations. The most relevant example in this case is acrylamide. Acrylamide is a chemical that naturally forms in certain foods, particularly plant-based foods that are rich in carbohydrates and low in protein, during processing or cooking at high temperatures. Acrylamide in high concentrations is harmful, for example to people who are exposed to acrylamide in the air in coal mines and who are more at higher risk of respiratory diseases, albeit not at higher risk of cancer. Nonetheless, there is some evidence that ingesting acrylamide can increase the risk of cancer in laboratory rats. However, ingesting acrylamide has not been shown to increase cancer risk in humans. this is because while humans and rats are quite similar in terms of physiology, they seem to metabolize acrylamide differently.
Nevertheless, even those studies that suggested that acrylamide was dangerous all agreed on the fact that anything less than 182ug of acrylamide a day is definitely safe to ingest. It is important, to keep in mind that for coffee-safety purposes whether or not ingesting high concentrations of acrylamide does slightly increase the risk of cancer is not the point.
Coffee has, at most, 358ug/kg of acrylamide. This means that the average cup has, at most, 0.45ug of acrylamide. That is a lot less than the 182ug that is the “safety limit” even by the most thorough standards. That means that you would need to drink about 400 cups of coffee a day for that to matter. While we have all felt like doing so, I don't believe anyone in their right mind has every drunk 400 cups of coffee in a day. Like in almost every case of blank-causes-cancer, it is a matter of concentration. Everything is toxic in a high enough concentration. For example, elemental iron ingested at 20mg/kg is really quite toxic. In fact, until recently iron poisoning was one of the most common causes of poisoning death in children under 6. Prenatal vitamins have about 27mg of iron in each one-a-day pill. That means that as an adult woman, if you took about 60 pills all at once you would get iron poisoning. Given that a bottle has typically 30 pills, it seems unlikely that you would do this on accident.
This all snowballed out of control when a judge in California decided to rule that coffee does indeed cause cancer, and should be labelled as a carcinogen the same way that cigarettes are. This was in response to a lawsuit that ought to have been thrown out as completely frivolous. The fact that important, intelligent people in positions of huge responsibility in our legal system have been convinced of this ridiculous notion is a huge red flag for our science education system. The system of legal checks-and-balances means that, thankfully, the California health regulators ruled that coffee does not, indeed, need a warning label. Brilliant, you might think. Problem solved. Let's move on. You would be wrong.
The real issue is that having the official position shift constantly erodes the public's trust in science. People's trust in scientific institutions is fast eroding and that is apparent from the way politics and news talk about scientific results. This is dangerous. If we want measles outbreaks to stop and if we want to start doing something about global warming, we need to start taking scientists seriously. That is not going to happen if well-meaning members of the public get the impression that science flip-flops every two days about huge issues. We have landed in a situation where a lack of science literacy has lead to a lack of public trust in science. This is an issue that affects all of us and, thankfully, an issue that we can start fixing right now.