I don't know where I learned this one, but so far, it's worked for me.
When picking out a pineapple, reach your fingers into the stem to find the innermost leaves [they're a little prickly, so beware].
Find the one closest to the center of the stem and try to pull it out.
If the pineapple is ripe and sweet, it will come out easily.
If you have to really pull, find another pineapple.