The Ghost type is notable for having few Pokémon, many of whom have low HP, and moves. In battles, the Ghost-type is useful because it's the only type that has two immunities: Normal and Fighting, both of which are common move types. From Generation VI onwards, Ghost-types are also immune to moves and abilities that prevent escaping, like Block and Shadow Tag.
Pokémon of this type are usually connected to fear, the dark and the afterlife. They usually live in abandoned houses, cemeteries, funeral places and uninhabited dark places such as caves. Also, Ghost-type Pokémon tend to be extremely naughty, pranking humans just to see their faces and reactions. Curiously, the more scared a human is, the more power the Ghost Pokémon will have to prank with it. At worst, some Ghost-type Pokemon may have relatively murderous behaviors, such as Jellicent preying on ships and their crews or the Litwick evolutionary family draining the life energy from people that are lost.
They're strong against the Psychic-type because some people are afraid of ghosts, and fears affect the mind. Communing with ghosts is also said to be a much different process than simply reading minds through physical or empirical means.
They're strong against themselves because there's a belief that the strongest spirit wins, with spirit referring to the desire to win something.
They're weak against the Dark-type because dark represents terror and evil, and it is said that evil spirits (like Spiritomb) are punished. According to some belief systems, ghosts who lead evil lives and refuse to go to the afterlife are said to transform into demons, and demons in some mythologies are feared and also rumored to eat lost souls.
They're immune to the Fighting and Normal-types because spirits are incorporeal beings and thus can't be hit normally. This is also the reason why the Normal-type is immune to them, because a mortal and a ghost can't hurt each other. Interestingly, the Fighting-type is not immune to them.
They're immune the Poison-type because it is impossible to poison someone who's already dead.
The only Ghost-type Pokémon of Generation I were Gastly and its evolutions.
The first pure Ghost-type Pokémon was Misdreavus, which was introduced in Generation II.
No Gym Leader or Elite Four member who specializes in Ghost-type Pokémon was introduced in Generation VI.
Similarly to the Dark type, the Ghost type is usually not straightforward when representing a Pokemon. Sometimes, Ghost Pokemon like Yamask and Gengar are this type because they are actual dead humans. This could also be seen as a term of murderous instincts like Jellicent which sinks ships and Froslass which freezes and keeps humans. It could also come from the fact that a normal item could be possessed by a ghost like Banette or Aegislash (Banette being a possessed doll and Aegislash being a possessed sword). This could also relate to the mischievous actions of ghosts like Misdreavus and Rotom. This could also be because they have supernatural powers like Hoopa or Giratina (Hoopa can create portals and Giratina can use the powers of gas-type-matter).