Take the bathing suit outside and hang it up so it can finish drying. When it's dry, use a toothbrush to gently scrub any areas that contain spots of greenish-white fungus. This is the mildew.
Fill a small bucket or sink with 2 parts white distilled vinegar to 1 part water. Agitate the water to mix. Saturate the suit in the mixture for 1 hour. Vinegar neutralizes smells and will help kill the bacteria causing the musty smell and mildew.
Transfer the suit to the washing machine and set the cycle to "Normal." Add laundry detergent plus 1 cup of white distilled vinegar. When the cycle is complete, the suit will not smell like vinegar.
Remove the bathing suit promptly when the wash cycle is complete. Do not allow it to sit in the moist air inside the washing machine. Transfer the suit to a well-ventilated area and hang it to dry. Acceptable areas include a bedroom or outside area.
Rewash the suit if the smell persists. Instead of vinegar, add 1 cup of baking soda to the laundry in addition to detergent. Wash the suit on "Normal" and hang it up to dry.