give up the ship

[give up the ship] {v. phr.} To stop fighting and surrender; stoptrying or hoping to do something.

"Don't give up the ship, John,"said his father when John failed a test.