Fruit flies can become a problem at any time of year because they are attracted to ripe or fermenting fruit. You can also be lucky and bring fruit flies home with you from the store sometimes. I'm sure that you've been grocery shopping and see tiny flies fluttering near the bananas or tomatoes.
So how do you tell fruit flies from other small flies you may find in your house? Adults are small (about 1/8 of an inch) and usually have red eyes. The front portion of the body is tan while the back portion is dark brown or black. If given the opportunity, females can lay up to 500 eggs. Larvae feed near the surface of fermenting foods or other organic matter.
Prevention is the best way to deal with fruit flies. Do not purchase over ripened fruit or vegetables. Fruit and vegetables should be eaten in a timely manner or stored in the refrigerator. If storage in the refrigerator is not an option because you are ripening the item, place it in a paper bag and use a clothespin or chip clip to close the bag. All recyclables should be rinsed thoroughly before placing them into the recycling bin. The recycling bin and garbage can (and compost bin!) should be cleaned out on a regular basis to eliminate any material that would attract the flies.
To eliminate a fruit fly infestation, all sources must be located and eliminated. Insecticides will not help if you do not get rid of where the flies are breeding. While searching and eliminating the source (breeding area), a trap can be constructed to capture adult flies. Create a paper funnel by rolling a piece of paper and securing it with a piece of tape. Place the funnel into a jar that contains a small amount of apple cider vinegar in the bottom. Instructables has a how-to on this process (but skip the hot glue gun & go for tape instead).
Photo of trap from Instructables.com.