by definition, a~b means there exists a k in Z such that a-b=3k
now
if a~a' and b~b' show ab~a'b'
Note: S=Z=(0,+or-1,+or-2,.......) and
_ _ __
a*b = ab
starting with your assumptions
$\displaystyle a-a'=3n$ where n is an integer and
$\displaystyle b-b'=3m$ where m is an integer.
so $\displaystyle a=a'+3n$ and $\displaystyle b=b'+3m$
so
$\displaystyle ab=(a'+3n)(b'+3m)=a'b'+3a'm+3b'n+9mn=a'b'+3(a'm+b' n+3mn)$
the term $\displaystyle a'm+b'n+3mn$ is an integer by the closer property of the integers.
so lets call $\displaystyle a'm+b'n+3mn=q$ then
$\displaystyle ab=a'b'+3q$ so ab~a'b'