The chemical reactions and pathways involving formamide, the simplest amide, HCONH2, derived from formic acid.