OP is young so let's not beat him up too bad. He's open to coaching and trying to learn which is more than a lot of newbies do here with all the arguing and know-it-all nonsense.
OP, you do need to learn how to be outcome indifferent, better known as IDGAF. My 20 yr old self would get piss*ed too like you are about chicks bringing up their exes. 80% chance they're doing it to get a rise out of you, 20% they're not over the person. It's hard to actually know though the younger ones are probably f*ucking with you.
Two things you can do:
1- S&D as has been mentioned. Move on as who needs the bull s*it. Not all women do this.
2- F*uck with her (my personal fave). If she brings up her ex, act really interested, but kind of patronizing, like "Wow, reaaaally? He sounds suuuuper cool. Whyyyy did you guys break up?" Her "bla bla bla." You: "Oh, thats tooooo bad. Man, he sounds like theeee one. You know, you should call him. Sounds like you two make a great couple. Try to get back with him. Ok, I'm really busy so I gotta go. Good luck tho. Ciao!" And end the the conversation. She'll likely be floored by your attitude. It's important *you* cut the call or
text and then go dark for a few days. If/when you re-engage with her, tell her you've been super busy. Start making co*cky demands like an arrogant d*ck (be laughing) about her coming over and cooking you dinner or giving you a massage because you're "suuuuuch a nice guy." Be a patronizing d*ck again. F*ck with her. Use IDGAF. Tell her to bring a friend too cuz two is company but three is a party and you like to have fun. Oh, and have her pick up a bottle of something good. Tell her no girly sh*t either.
Good chance she'll come over if you turn the tables, act like a d*ick, and call the shots. Be a boss and walk if she won't play.
Good luck.