Help understanding the function of my circuit. (Bug swatter)
What is the function of the capacitor in this circuit and why is it
  connected to the diode?


My guess would be the diode is half wave rectifying the output of the transformer and charging the capacitor up. The capacitor provides the energy storage need for the racket to do the deed of dispatching the poor insect which has provide the connection to short the two copper rackets.


  My two copper rackets (see first figure) discharge when they hit each
  other. How does this work?


Again, my best guess is the capacitor is connected across the copper rackets so touching them together shorts out the capacitor. 


  What function do the resistors have? Are they in series or in
  parallel?


They'll be for current limiting on the output of the transformer so when the rackets are shorted together you don't damage the diode / transformer / transistor (depending on how the components are rated and sized). Some of them will also probably be for tuning the self-oscillating circuit that drives the input side of the transformer.


  The product says it could generate a >1000V. Why isn't this harmful to
  a human being?


Although it can develop high voltage, more than enough to hurt someone, it does so at such low current and energy levels it might give you a superficial burn at worst.