A point US Senator Kirsten Gillibrand makes about failure resonates well with Theory of Algorithms and The Core Algorithm: If you've failed at something, it doesn't mean that you're a failure or that you'll fail against at that thing. The outcome can be very different the next time. I do find that some people generalize from one incident, or even a handful of these, and ascribe an entire set of enduring characteristics to those involved in that incident. It's like: make a mistake, and you (and everyone like you) will always make mistakes. Instead, things can be different down the road.
Another point about failure: Both failure and success are have comparable potential to teach us important lessons. So, contrary to some people, I avoid glorifying failure as the better teacher. Any experience or outcome can be an opportunity for learning, if we reflect on it vis-a-vis what we're trying to accomplish.
Don't give up. Gillibrand is walking proof, I imagine, who's persisted in her life and achieved a rank in government. But I think the advice is far trickier than a simple call to keep going. There are times when it makes sense to keep going, and other times when it is better to stop, shift course, or abandon the effort altogether (i.e., give up). The challenge is that we don't always know which situation it is that we're in. But if you believe something deeply, and you know it to be right, and you feel it in your bones, then it makes sense to keep going. In any event, it's a matter of personal judgment and personal choice. At the very least, reflect on how things are going vis-a-vis your purpose, and decide thoughtfully about how to go forward.