Perhaps the only and one time, one must consider giving up is when after repeatedly doing some action, the result is the same, against the expectation of a better outcome. In such situations it is like flogging a dead horse, in fact, continuing with it, will tantamount to lunacy.