Why does Goku give up against Cell?
Because he knew someone who could defeat Cell - his son, Gohan.

He knew for certain that his son Gohan would be able to defeat Cell, and so the fate of the world wouldn't 100% depend on Goku. And so, after tiring Cell for a bit, he gave up to allow Gohan to battle.