Can functions be defined by relations? So let us say that for whatever reasons, we are not allowed to use function symbols in first-order logic. Then can we define and use a function only by relations? 

Usually functions are defined in the language of set theory. Here is a possible definition using only FOL:
Let $D$ and $C$ be unary predicates. Let $F$ by a binary predicate. 
$F$ is said to be a functional relation with domain predicate $D$ and codomain predicate $C$ if and only if:


*

*$\forall x,y:[F(x,y)\implies D(x)\land C(y)]$

*$\forall x:[D(x)\implies \exists y:[F(x,y)]$

*$\forall x,y_1,y_2:[F(x,y_1)\land F(x,y_2)\implies y_1=y_2]$
