I need help to get started with proving the 'only if' part of the following claim:

Let r be a relation. Define ~ to be the intersection of all equivalence relations containing r (So ~ is an equivalence relation.)

Show that x~y if and only if one of the following holds:

i) x=y

ii) (x,y) $\displaystyle \in$ r'

iii) there exist $\displaystyle z_1,z_2,...,z_n$ such that $\displaystyle (x,z_1)\in r', (z_i,z_{i+1})\in r', (z_n,y) \in r' $ where (x,y) $\displaystyle \in$ r' means (x,y) $\displaystyle \in$ r or (y,x) $\displaystyle \in$ r and i=1,...,n-1