I'm simply wondering if there are any types of yarn that hold up well in water? Or should crocheted swimwear not be used for actually swimming?
Synthetics: good choice. Synthetic materials (made prom petroleum compounds) don't soak up any water and therefore dry very fast. They usually don't sag while wet and hold their shape for a long time. Depending on the manufacturing process, they can be created already colored, so they cannot bleach in chlorinated water. Since they don't soak up water, they are very resistant to damage by salt water.
Synthetic natural fibers: ok to bad choice. This category includes things like modal, viscose / rayon, bamboo and other fibers synthetically made from natural sources like cellulose. They usually soak up a lot of water and take long to dry. Their colorfastness can vary, but I would compare it to cotton. As natural fibers they are damaged by salt water.
Cotton: bad choice. It soaks up a lot of water, which makes it sag and stay wet for a long time. It also loses color when you swim in chlorinated water and it's easily damaged by swimming in salt water.
Linen: ok with caveats. It also soaks up water, but dries faster than cotton. Linen is notorious for not being color fast and it's bleached even faster by swimming in chlorinated water. Since linen fibers are usually somewhat sturdier than cotton fibers, it withstands salt water a little better, but only a little.
Wool: probably bad choice. Wool doesn't soak up much water, so it dries faster than cotton. It also retains some warming properties while wet. But wet wool has the tendency to sag a lot and stay in that shape if not dried properly. Wool can be very scratchy and uncomfortable when worn directly on the naked skin. It also has a tendency to shrink and felt it it's moved a lot while wet. I cannot asses it's color fastness, but as a natural fiber it's also damaged by salt water.