For it to be transitive (1,2) would need to exist in the relation. And it does, because a and b happen to be the same number. But sets don't contain duplicates, so it either is transitive, or it cant be transitive if a and b are the same value.
A relation is transitive if whenever a~b and b~c we have a~c.
So when do we have both a~b and b~c?
Well, the only relations we have are 1~1 and 1~2. So if b~c then we must have b=1. So then we have a~1, which must mean that a=1. So the only two cases to check are $a=b=c=1$ and $a = b = 1$, $c=2$. That is:
- Since 1~1 and 1~1, we must have 1~1 if the relation is transitive.
- Since 1~1 and 1~2, we must have 1~2 if the relation is transitive.
Both of these hold, so the relation is indeed transitive.