It's a fine line to walk. When faced with an untenable situation, how do we know how long to continue to work to change it and when do we know it's time to surrender? There is no clear answer for most situations. We have to trust ourselves and apply an appropriate amount of persistence!
Often times we can be 'conditioned' just just 'give up' and stop trying. There is a teaching story told about how baby elephants are trained. The baby is tethered to a large and strong steak in the ground with a strong rope. The baby elephant struggles and struggles to try to break free, but it can't. At some point it finally give up and knows that when it is attached to a rope, it cannot move freely. After that critical point, they don't even need to be tethered to anything! Their rope can simply be draped over a railing and they will not try to walk away. They have come to associate the rope with being trapped and stuck. They don't even try. The truth is, they could get away any time they want to. They simply don't try.
We can be the same way. We always need to be vigilant for areas where we settle for something unacceptable, simply because we have come to believe there is no alternative. Often times, we are trapping ourselves!
Likewise, sometimes we really can't change a circumstance, and if we continue to beat our head against the wall, we merely exhaust ourselves needlessly.
There is a balance to be struck here and it will be different for each of us and it will vary from situation to situation. The most important thing is to remain conscious and keep asking ourselves what the appropriate course of action is.
Conscious awareness is the key!