This is Velleman's exercise 4.3.8 (And not a duplicate of "$R$ is transitive if and only if $ R \circ R \subseteq R$"):
Here's my proof of it:
Proof.
($\rightarrow$) Suppose $R$ in transitive. Let $(x, z)$ be an arbitrary element of $R \circ R$. By the definition of composition there must be some $y$ such that $(x, y) ∈ R$ and $(y, z) ∈ R$. Since $R$ was transitive then from $(x, y) ∈ R$ and $(y, z) ∈ R$, we get $(x, z) ∈ R$. Since $(x, z)$ was arbitrary then we can conclude that $R \circ R ⊆ R$.
($\leftarrow$) Suppose $R \circ R ⊆ R$. Let $x$, $y$, and $z$ be arbitrary elements of the set $A$ such that $(x, y) ∈ R$ and $(y, z) ∈ R$. Now by the definition of composition we have $(x, z) ∈ R \circ R$. Hence from our hypothesis we get $(x, z) ∈ R$. Since $x$, $y$, and $z$ were arbitrary then $∀x ∈ A∀y ∈ A∀z ∈ A((x Ry ∧ yRz) → x Rz)$. Ergo $R$ is transitive.
From ($\rightarrow$) and ($\leftarrow$), $R$ is transitive if and only if $R \circ R ⊆ R$.
Is my proof correct? I'm particularly concerned with the part that I introduced the set "A" in the backward direction.
Thanks.