Can an unpeeled hard boiled egg be eaten?
Please be a bit more elaborate as to what the issur might be. what about an half an onion that still has its peel, but the other half was used?
An peeled egg should not be eaten if it was left overnight.
An onion that is cut in half can be eaten, provided the peel remains on the cut half.
Please see sources, below.
The Gemara (Niddah 17) writes that eggs, onions, and garlic, which are peeled and left overnight (without before being mixed with other ingredients) may not be eaten, because an “evil spirit” rests on them.
This halachah is not mentioned by the Rambam or the Shulchan Aruch, perhaps because they reasoned that the ways of ruach ra’ah (the evil spirt) have changed, yet it is mentioned by the Semak (168), by the Peri Chadah (116), and by the Shulchan Aruch Harav (Shemiras Haguf Vehanefesh), and cited by later authorities.
Therefore, if an unpeeled egg is left overnight, it should be discarded. But if some of the peel remains, or if “egg salad” has been prepared by mixing with oil and spices, the egg or egg salad can be left overnight.
Thus, if an onion is cut, but not peeled, it is permitted to consume the other half even after leaving it overnight.