I've approached at the gym a handful of times and had some very bad experiences with the women I met, it wasn't the approach itself but the behavior of the women, which I'll get into below.
First, it is fairly easy to spot the women that are looking to be left alone. One thing you might notice is women wearing baseball caps kept really low, so as to avoid any form of eye contact. This is generally a sign that she is not at all there to socialize and is in and out.
Most people wear headphones at the gym so don't take this as a sign that they aren't open to being approached.
As for approaching itself, I've found a couple things can work depending upon your degree of comfort. A simple "Are you using this?" or "Will I be in your way if I'm here?" will get here to respond to you and from there you'd be able to gauge if she is open to talking or not. I actually did this at the gym a few months ago with a woman who was using a platform that I needed and we had a brief banter back and forth, I honestly wasn't interested but in a situation like this it's easy to introduce yourself and build some rapport.
I've also approached directly before where I just walked over and said hi. I think this can work but I personally feel that the above method is better because it's lower stakes and doesn't create a potentially awkward scenario that both parties are put into.
You also need to be aware of any signs of disinterest from women and cut it off quickly, this is just to avoid creating any drama in an environment that you frequent. Something else to be mindful of is attention whoring/being led on, if you pick up on this cut her off immediately and do not at all entertain her. I've had a couple women do this where we exchanged contact info and they agreed to dates, which didn't happen. These women created these awkward scenarios for no reason but in situations like this you need to walk away.