\nonstopmode
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\pagestyle{empty}
\begin{document}
$$
f(n)={\begin{cases}n/2,&{\mbox{if }}n{\mbox{ is even}}\\3n+1,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}
$$
\end{document}
