Let / and g be functions of a set 5 into a semiprime ring R. A necessary and sufficient condition for / and g to satisfy f{s)xg{t) = g{s)xf{t) for all s, t e S, x e R is given. As an application, biderivations and commuting additive mappings of semiprime rings are characterized.