谢谢,Mico!
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
$f\colon\mathbb{Z}\to\mathbb{N}$ is more correct than
$f\colon\mathbb{Z}\mapsto\mathbb{N}$.
\begin{align}
f\colon\mathbb{Z}&\to\mathbb{N}\notag\\
n&\mapsto \left( n\mod 3\right)^2
\end{align}
\end{document}
![在此处输入图片描述](https://i.stack.imgur.com/DiejY.png)