First, keep in mind that not all fruits are ideal for cake decoration. Some fruits oxidize or turn yellow very quickly, like apples, while some fruits easily turn bad or deteriorate, like bananas. However, for fruits that are commonly used as cake toppers, there is something you can do to make sure they don't turn moldy or go bad very quickly. You can soak them in a mixture of water and white vinegar. Combine four cups of water and half a cup of white vinegar, add in your fruits, and leave them for five minutes. Rinse them in cool water and dry them on a paper towel. Doing this will extend the life of your fruits as it will get rid of mold, but without affecting the taste of your fruits.