When you purchase berries & get them home, prepare a mixture of one part vinegar (white or apple cider) and ten parts water. Dump the berries into the mixture and swirl around. Drain, (rinse if you want, though the mixture is so diluted I find you can’t taste the vinegar) and pop in the fridge.
The vinegar kills any mold spores and other bacteria that might be on the surface of the fruit, and voila! Raspberries will last a week or more, and strawberries go almost two weeks without getting moldy and soft.