DC motor H-Bridge - Snubber Cap
Your capacitor is getting hot because it has a 25kHz 12V square wave across it. Every time the switching FET turns on it connects the capacitor directly between ground and +12V, which causes a very large current spike as the capacitor charges up. Then when the FET turns off the capacitor discharges through the motor with a current equal to the motor current. At 25kHz a 5uF capacitor will be discharging continuously at 1A during PWM 'off' time, and could be charging with a peak current of 20A or more (depending on how fast the FET turns on). This may result in a power loss of several watts in the capacitor.

You only need a small capacitor across the motor terminals to suppress the RF noise caused by brush arcing. Typical values used are 47nF from terminal to terminal, or 100nF from each terminal to the case (which 'grounds' the case to RF and provides 50nF across the terminals). A smaller capacitor needs less energy to charge and discharge so the rms current and heating is lower. 50nF is 100 times less than 5uF so it should have insignificant power loss, but an even lower value would be better if it still sufficiently suppresses RF noise. 

The motor has relatively large inductance which tries to maintain current flow when the FET is switched off, and it will generate whatever voltage is required to make this happen. In a bridge circuit this 'flyback' current goes through the diode across the upper FET (M4 in your schematic) which limits the inductive voltage kick to ~0.7V above the supply voltage. This is much better than using a snubber capacitor to absorb voltage spikes because it returns most of the inductive energy back into the motor rather than burning it off externally.             

MOSFETs have internal body diodes which are usually strong enough to handle the full motor current with reasonably low loss, so external flyback diodes are not normally needed. 

However you do need a large low ESR filter capacitor across the power supply to prevent voltage spikes on the power rails. Remember that when PWM is applied current is drawn from the supply only during the PWM 'on' time, and this pulsing current will induce voltage spikes caused by inductance of the power wires. Without filtering these voltage spikes could go high enough to damage the FETs and other parts of the circuit. The capacitor should be connected as close as possible to the FETs to reduce inductance and resistance, and since it may have to pass significant ripple current it is better to use multiple smaller capacitors in parallel rather than a single larger one.

As soon as you have proved basic circuit operation you should move it off the breadboard. These are infamous for having high resistance connections which can cause weird effects, and the strips are only good for about 1A max.