Graph Functor is Functor

Definition
Let $\mathbf{Set}$ and $\mathbf{Rel}$ be the category of sets and the category of relations, respectively.

Let $G: \mathbf{Set} \to \mathbf{Rel}$ be the graph functor.

Then $G$ is a functor.

Proof
For any set $X$, we have:

Thus $G$ preserves identity morphisms.

For mappings $f: X \to Y$ and $g: Y \to Z$, we have:

Hence $G$ is a functor.