What kind of connector is this, where can I get one, and how do I attach it?
It's a JST type connector. You could get cheap ones from ebay and such, or get real ones from your typical electronics retailers, digikey, jameco, etc. This is the plastic connector, the crimp terminal (the metal part), and an appropriate crimp tool. The crimp is held in place by plastic tabs (Looks like an E on the connector in your picture).

But for one off parts or project, just cut off the wire close to the old fan, and solder + heatshrink the new wires on. Simplest, cheapest route.