I'm not sure if I would stay in the relationship. There are a lot of factors that would need to be addressed. What led my significant other to become emotionally involved with someone else in the first place? Why did the affair end? (Did I catch them? Did the othe party end it? Was it too many obstacles to overcome that caused them to give up their dream of being together?)
At the end of the day cheating is about (lying and betrayal). If someone tells you that you are the only one they love or want and you find out they are telling another person the same thing or acting as though you don't exist when you are not around then it would difficult to trust them again. Unless deep down you felt (your behavior) pushed them away I can't see why anyone would want to stay with someone who proved to be untrustworthy.
My relationship philosophy is fairly simple. When you love someone give it your all and your very best. If someone cheats on you after you have done that it makes no sense to give them a "second chance". If your best wasn't enough for them to value and respect the relationship then they were not right for you. There is nothing better than your best!