There is a couple of thing you can look for.
If you press the pineapple lightly with your finger it should have a little give to it. You can also tap the pineapple with the palm of your hand the sound that it makes should be muffled, not hollow sounding.
Avoid pineapples with spots or...