In the book they solve it by taking examples. Let x be this,y that,z and y those and they just put in condition. But all values do not give same result.
I took $x$, $y$, $z$ as $\sqrt 3$, $\sqrt 2$ and $4$. Let $(x,y),\ (y,z) \in R$, $xy\in R$ and $yz\in R$ that gives $xy= \sqrt 6$ and $yz=4\sqrt 2$. On solving for $x$ and $z$ from these equations and they multiplying $x$ and $z$, $xz= \sqrt 6$ which is irrational and $(x,z)\in R$ but in answer they solved it like

How different results from different values?
A relation R on a set X is transitive if, for all elements a, b, c in X, whenever R relates a to b and b to c, then R also relates a to c.
Note that,
if transitivity holds,it is true for $\textbf{all}$ elements a,b,c in X.
Here,in your example (x,z)$\in$ R but,in your book's example,and also in the example in 2nd comment, (x,z)$\notin$ R.
So, (x,z)$\in$ R does not hold for all x,y,z $\in$ R.
So R is not transitive.