I want to know how to compute this function: 

$f : \mathbb{Z}_m \rightarrow \mathbb{N}$

$f(z) = |\{ (x, y) \in \mathbb{Z}_m^2 \mid xy \equiv z  \}|$