What do you do when someone tells you they don’t want to be with you but want to keep flirting as if you’re still together?

Tell them clearly: “Since we’re not together, I need you to stop [flirting behaviors].”

If they refuse to respect this boundary, or argue that you’re being irrational, or deny that they’re doing it, stop spending time with this person.