the capacitor will smoothen the current flow when throttle engages from idle to full throttle. it also has the advantage during the start because it leaves a charge inside the capacitor thus give you a better response when the race will start
regarding the diode yes it is needed too. because it will take care of your esc when you let go of the throttle coming from full power.. it gets the excess current coming from the motor saving your esc to get some of that excess current. in other words no current will get back inside your esc when you use the diode.
running without them is okay for stock but to be on the safe side install them.. on the other hand for modified i suggest you use them.