What's the difference between "function" and "relation" in logic? What's the difference between "function" and "relation" in logic?
Why do we cosider them apart?
I think every relation expresses a function...
 A: In FOL (first-order logic) a function symbol has terms (i.e. "names") as input and output.
For every pair $n,m$ of natural numbers, $+(n,m)$ (usually writteh: $n+m$) denotes a number.
Predicate (or relation) symbols have terms as input and produce sentences.
For every pair $n,m$ of natural numbers, $<(n,m)$ (usually writteh: $n < m$) is true or false according to the fact that the number $n$ is less or not than the number $m$.
A: A function takes terms as arguments, and results in another term, denoting an object.
A relation takes terms as arguments, and results in a sentence, denoting a claim
As such, a relation (i.e claim) can be said to hold true or not, but it makes no sense to say "this function (i.e object) holds true (or false)"
A: As Mauro Allegranza's answer, in FOL (first-order logic) a function symbol has terms (i.e. "names") as input and output.
For every pair n,m
of natural numbers, +(n,m) (usually written: n+m) denotes a number.
However, a predicate or relation symbol has terms as inputs and produces a formula (which may or may not be a sentence). Note that a formula is a sentence in FOL only when the formula doesn't have any free variables.
So, citing the same example, for every pair n,m of natural numbers, <(n,m) (usually writteh: n) is true or false according to the fact that the number n is less or not than the number m.
Relation: I'm defining a relation called "fatherOf", so consider the following sentences:
fatherOf("Barack Obama", "Malia")
fatherOf("Barack Obama", "Sasha")
¬fatherOf("Sasha", "Michelle") 
Since we know that Barack Obama is the father of Malia and Sasha, the relation fatherOf holds in the first two cases while it doesn't in the third case (note the not symbol).
Function: Now let me define a function called "getFather" and consider the following examples:
getFather("Sasha") --> "Barack Obama"
getFather("Barack Obama") --> "Barack Obama Senior"
Notice that the function "getFather" takes as input a person and returns another person.
