Black layer in an onion
This is either mold or bacteria-caused rot. Don't eat it - the microorganisms which feed on raw plants are rarely pathogenic for humans, but will frequently create toxic metabolic byproducts. I would throw out the whole onion, molds can be toxic in very low doses, just from contamination between layers.