I was cutting up an apple for a salad, and after removing the peel I encountered loads of brown spots. There weren't any notable damages on the peel, nor any soft spots when feeling the apple when I bought it. The brown spots themselves are softer than the actual apple, but apparently not soft enough to be noticeable when handling the apple with its peel stil on. Also, some of the spots were 'deeper' into the apple, and not immediately noticeable when removing the peel, they only became noticeable when cutting it into pieces. This is what the worst part of it looked like after I already cut away quite a bit:
Since similar spots (in smaller quantities) were present throughout the entire apple, I threw this apple out, but I'm wondering what caused these spots, and most importantly how I can prevent having apples with these spots. Could I have prevented buying this apple like this, or is this something I caused by storing it wrong? Also, are these spots safe to eat?