I'm trying to unserstand Yamanaka's iPS cells paper
Suppose you want to insert a cassette in a gene.  How will you know it is there?  What if only a small percentage of cells are successfully transfected?  What if your reagents were bad.  You do not want to waste time on cels that did not take up your cassette.

Those resistance genes are for detection of the presence of the cassette in a cell (or colony derived from a single cell).  You can have other things ride along with your cassette that will let you detect its presence.  Neomycin resistance: if you grow the cells that you have engineered in the presence of neomycin, only the ones that successfully got your cassette will live because the cassette gave them resistance.  All the ones that did not take up the cassette, or took it up wrong will die.  

An active beta-galactosidase gene can work on a substrate to make a blue color.   


  An active enzyme may be detected using X-gal, which forms an intense
  blue product after cleavage by β-galactosidase, and is easy to
  identify and quantify.


Again this lets you detect cells (or colonies of cells) which have successfully taken up your cassette.