Load the xcolor package in the document preamble (\usepackage{xcolor}). Inside a math inset, start by typing \colorbox and then press the space bar. Now type \{, which should create a pair of braces surrounding an inset, and type the background color name (e.g., cyan) inside. The color name will look like a math formula (c times y times a times n), but don't worry about that. Just after the closing brace, type \{ again, and type the actual formula in the new inset.
Paul