You can just type LaTeX formulas between dollar signs! There are some occasional strange behaviors: see the FAQ and this meta.MO thread for details. Basic solution: if you're having problems with the preview (or the post looks wrong), put backticks around any math that contains underscores or asterisks. E.g. write `$f'_n=g_{n+1}$`.