In order to determine the difference between a relation and a function, consider the following definitions:
In a relation a set of inputs have a corresponding set of outputs that are related in some way.
In a function there is a specific kind of relation in which one input only has one output, that is, in a function, an input can not have two o more outputs, only one.
Hence, the difference is that a function is a relation one-to-one between inputs and outputs, and a relation is more general, here, one input can have two o more outputs.