I've played my fair share of competitive games so I might as well chime in for the "gg" discussion.
"gg" originates from professional StarCraft, as far as I know. In StarCraft, the game is "over" far before it ends; the game drags on for quite a bit if no one surrenders, but the victor is absolutely certain. Because of this, the polite practice is to say "gg" and leave the game once you are at a decisive disadvantage. Generally the winner would respond with a polite "gg" of his own.
Even though saying "gg" was polite, it could also be used in a bad-mannered ("bm") way. If you felt you were at an insurmountable advantage and the opponent stubbornly stayed in the game, you could say what's called an "offensive gg" by typing "gg," as a way of scolding the other player for not leaving. Historically, it was always left to the loser to initiate the "gg" exchange.
In my opinion, if the loser doesn't say "gg," you probably shouldn't bother. It kind of comes off as patronizing to a person who's already in a bad mood (as indicated by their abstinence from saying "gg"). If they don't say it, they probably don't want to hear it.
As for "glhf" and variants, it's just being polite. It doesn't really mean much in a literal sense but is just a formality really.