I will note that my Pineapple has yet to flower and produce a new pineapple, but as I live pretty far north and do not really go out of my way to get it enough light I am not too surprised. Mostly my pineapple plant just hangs out as an enormous bromeliad.
What you will need:
A glass of water
A pot of soil
2 years (or more)
Step 1: Buy a pineapple. Make sure the leaves on top are green. I've never seen a pineapple that didn't look like the leaves looked at least moderately healthy, but I assume it's possible.
Step 2: Cut the pineapple's top off. Cut right where the leaves exit the fruit, or a bit lower.
Step 3: Take the top and slowly cut thin layers off until you see root nubs.
Step 4: Once you see the root nubs, start removing leaves from the base. I removed about an inch of leaves total.
Step 5: Now that your pineapple top is ready, let it dry for 24 hours. This is to prevent rot. I cannot actually remember if I did this step (it's been 3.5 years), but it's what you are supposed to do.
Step 6: Place the top into a glass of water so the root nubs are submerged but the leaves are above the water. Put the glass somewhere it will receive light for the next 1-2 weeks.
Step 7: Watch the roots slowly grow. It took about a week or so for the roots to grow to be an inch long.
Step 8: Once the roots are an inch or so long, take the top out of the water and Very Gently plant in soil. I just used the random garden soil I had lying around.
Step 9: Place in a southern facing window and water regularly, but don't keep it soaked. If in doubt the pineapple will do better with a little less water than too much.
Step 10: Slowly give up more and more of your house or apartment space to the monster you have created. Mine is currently 4 feet across and harassing all the other house plants on its shelf.
In theory a pineapple can start to flower and bear fruit after ~2 years, That has not been the case for me and I believe it is due to sub-par lighting, but it is still very much alive and kicking, so I have my fingers crossed that one day I may yet get a second pineapple from my original purchase.