I have the following exercise from the book "How to prove it", chapter 4.5, p.211, problem 9.
Suppose $R$ is a relation on $A$, and let $S$ be the transitive closure of $R$. Prove that $\operatorname{Dom}(S) = \operatorname{Dom}(R)$ and $\operatorname{Ran}(S) = \operatorname{Ran}(R)$
Since I had no idea how to approach it, I looked at the hint in the appendix where it says:
Hint: Let $T = \lbrace(x,y) \in S \mid x \in \operatorname{Dom}(R) \text{ and } y \in \operatorname{Ran}(R)\rbrace$. Prove that $R \subseteq T$ and $T$ is transitive.
I really don't understand why this should then be the proof. Can somebody explain the rational behind this to me?