In the new manual Math.lyx, there is a solution (section 15 Functions )
: As an example, if you want to define the sgn function, you put this
lines in the LaTeX preamble :
\DeclareMathOperator{\sgn}{sgn}
Then you can use \sgn in your formulas.
Hope it helps.
Siegfried.