How does this circuit in an electric mosquito swatter work?
The resistor across the 240 VAC mains series cap, C1 serves to drain residual charge, to prevent possibility of a small shock. Depending where in the AC cycle the device is unplugged, the charge on the cap could be as much as 1.414... times the RMS (nominal) AC mains voltage, ~340 VDC.
Why not? If it's sealed inside a case, double-insulated, there's little chance of shock from touching battery and ground. Oh... do you mean is the 2.4 V battery getting 240 VAC? No, because C1, a 0.49 μF capacitor, has a reactance of ~6,500 Ω at 50 Hz, and ~5,400 Ω at 60 Hz, limiting the voltage and current across the battery. That would produce a charge rate of ~ 36mA at 50 Hz. BTW, I would not leave the swatter plugged in permanently, since that might be more current than good for long-term trickle charge on a small NiCd or NiMH cell.  
You can check winding connectivity with an ohmmeter, but basically, the emitter and the B+ are connected to pins 1 &amp; 6, the primary winding; pins 2 &amp; 3 are feedback windings, sending signal to base to cause oscillation; and 4 &amp; 5 are high-voltage secondary output.
The diode-capacitor combination on the output serve as a voltage multiplier. In this device, it triples the voltage from the secondary to charge C6, which stores enough power to permanently incapacitate an arthropod (give it "a short, sharp shock, from a cheap and chippy chopper", as G&amp;S put it).


BTW, the Cockcroft–Walton generator uses voltage multiplication to generate megavolts from lower-voltage AC. No, I don't suggest building a basement particle accelerator or X-ray machine.