Let Mn, be the algebra of all n × n matrices over a field F, where n ≧ 2. Let S be a subset of Mn containing all rank one matrices. We study mappings φ: S → Mn, such that F(φ (A)φ (B)) = F(A B) for various families of functions F including all the unitary similarity invariant functions on real or complex matrices. Very often, these mappings have the form A ↦ μ(A)S(σ (aij))S-1 for all A= (aij) ∈ S for some invertible S ∈ Mn, field monomorphism σ of F, and an F*-valued mapping μ defined on S. For real matrices, σ is often the identity map; for complex matrices, σ is often the identity map or the conjugation map: z ↦ z. A key idea in our study is reducing the problem to the special case when F:Mn → {0, 1} is defined by F(X) = 0, if X = 0, and F(X) = 1 otherwise. In such a case, one needs to characterize φ: S → Mn such that φ(A) φ (B) = 0 if and only if AB = 0. We show that such a map has the standard form described above on rank one matrices in S.