The chemical reactions and pathways involving fumarate, the anion of trans-1,2-ethenedicarboxylic acid, the diastereoisomer of maleate. It is a key intermediate in metabolism and is formed in the TCA cycle from succinate and converted into malate.