When do you know when to give up? Do you really think it's a decision that you conciously make and then start actively "giving up"? I think it's more likely that gradually over time she becomes a less attractive option for you. The longing diminishes, maybe even life with the X looks unappealing, and one day you look back and say..."what was I pining away for anyway? I can't believe I wanted her back." In my case (in my first marriage) it took a couple years. Now I look back and can't believe I would have thought like that.
What if she chooses the married guy? I personally wouldn't want a woman that would actively seek a relationship with a married guy. I wouldn't say or do anything...it's short term at best. I feel for the married guy's wife, but don't know whether I'd be a but-in-ski and tell her. Unless your wife is doing things dangerous for the children, you really don't have much say. It really isn't your decision who she pals around with.
In the end, it's not the years in your life that count. It's the life in your years. Abraham Lincoln
It is hard to fail, but it is worse never to have tried to succeed. Theodore Roosevelt