I understood up to now that the term 'law of composition' was an older alternative to 'binary operation'. But according to this Wikipedia disambiguation page it is an alternative to 'binary function'. Which is correct? Also, which term is preferred, out of 'law of composition' and 'binary operation', if any?
A binary function is a function that takes two inputs and produces an output; a binary operation is the same except that the inputs and output are all supposed to come from the same set. "Law of composition" is indeed an older term, and I don't recall having seen it used for anything more general than binary operations. Nevertheless, if someone were to use "law of composition" to refer to a binary function whose inputs and outputs come from different sets, I would not be shocked and would not object; the same applies if someone were to use "law of composition" to refer to a function with more than two arguments.