Your nose and fingers are better judges than your eyes. So smell it: if it smells fresh, even if it looks ugly, you’re probably fine. Touch it: if it’s firm and a little wrinkly, it’s just old. But if it’s sticky or jelly-like, that’s bad.
Also, remember this: the most dangerous apple is the one you never eat because you were too scared of a bruise. Throwing away good food is a waste, and it’s kinda sad. So be kind to your slightly ugly apples—they’re the underdogs of the fruit bowl.