"Give up" has 6 definitions and is separable.
In general, "give up" implies a sense of defeat or surrender. It may seem to always be used in a negative sense, but whether it is used in a positive or negative way really depends on the context.
1. To stop a habit or things that you do regularly.
"Eve was finally able to give up smoking."
"He gave up his job when it became too competitive."
2. To surrender or admit defeat.
There are several situations where this might be used.
- In a match with an opponent
"It's important to know when to give up in a chess match."
- With the police or authorities
"The burglar gave himself up to the police when he ran into a dead end."
- Guessing - usually after a few attempts
"I haven't given up yet! Give me another clue."
3. To stop making an effort before completing something, usually because it is too difficult.
"You can't just give up when things start to get challenging."
"Wally finally gave up on the project. There was just too much red tape."
4. To stop owning or give away something you own.
"Being ambitious shouldn't mean giving up previous time with friends and family."
"We had to give up the dog when we moved overseas."
5. To abandon (oneself) to a particular feeling, influence, or activity.
To me, this is usually used in a disapproving way.
"Don't bother. He's given himself up to his own melodramatic despair."
6. To stop hoping that someone will arrive.
"It's been over an hour. We'd almost given you up."
To me, it's more common to say...
"We'd almost given up on you."
"Give up the idea of something"- you decided not to do something you had previously decided to do.
"He had given up the idea of starting a family."
"Give up the ghost" - to die or stop working.
This is still a fairly well-known expression even though I think this is not that commonly used. It has its origins in the Bible to refer to people dying. Nowadays, we use it to talk about machinery that has stopped working.
"The printer gave up the ghost just before my assignment was due."