Flour that has gone rancid usually won't make you sick the way most spoiled foods can. Usually. Sometimes flour can be contaminated with mycotoxins which are toxic substances produced by molds such as Aspergillus species, or by other harmful nasties that can grow on flour that has been stored in damp or less than ideal conditions. If that is the case, throw it out. Don't try to salvage it.
But what about flour that looks and smells OK, but it's just a bit old?
Food experts agree that over time, foods made with flour that is too far beyond its useful shelf life can be harmful to your health. Besides a major loss of nutrients in old flour, rancid oils in the grain can destroy some of the B vitamins and vitamin E in your body. It can also form toxic compounds that may contribute to cancer, heart disease, and neurological disorders.