First off, you need to tell your mom that you think you have an infection so it can be treated. It's not something you want to just leave alone as the infection can get worse. Second, if you are on your period, use a tampon, if not, you don't need to wear anything. Just make sure not to stay in your wet bathing suit for a long period of time, as that can help the infection get worse or spread. A few hours of swimming is fine, but try not to be wet down there all day. Make sure to dry off and change into clean dry clothing.
A tampon is not needed.. you should be fine swimming!