Prove that this is an equivalence relation Let $K$ be a field and $p(x)\in K[x]$ an irreducible polynomial with $\deg p=n>1$. 
In $K[x]$ we define the following relation: $$f(x)\equiv g(x) \Leftrightarrow p(x)\mid (f(x)-g(x))$$ 
I want to prove that this is an equivalence relation. 
I have done the following: 


*

*$f(x)\equiv f(x) \Leftrightarrow p(x)\mid (f(x)-f(x)) \Leftrightarrow p(x)\mid 0  \ \ \checkmark$ 

*When $f(x)\equiv g(x) \Leftrightarrow p(x)\mid (f(x)-g(x))$ then we have also that $p(x)\mid (g(x)-f(x)) \Leftrightarrow g(x)\equiv f(x)$ 

*When $f(x)\equiv g(x) \Leftrightarrow p(x)\mid (f(x)-g(x)) \\ \Rightarrow f(x)-g(x)=r_1(x)p(x) \Rightarrow g(x)=f(x)+r_1(x)p(x)$ 
and $g(x)\equiv h(x) \Leftrightarrow p(x)\mid (g(x)-h(x))\Rightarrow g(x)-h(x)=r_2(x)p(x) $ 
then we have that $f(x)+r_1(x)p(x)-h(x)=r_2(x)p(x) \Rightarrow f(x)-h(x)=(r_2(x)-r_1(x))p(x) \\ \Rightarrow p(x)\mid (f(x)-h(x))$ 
Is this correct?
 A: It seems good, but I don't like at all the style. Your use of $\Leftrightarrow$ is disputable.
Reflexivity Let $f(x)\in K[x]$; since $f(x)-f(x)=0$ and $p(x)\mid 0$, we have that $f(x)\equiv f(x)$.
Symmetry Assume $f(x)\equiv g(x)$. Then $p(x)\mid (f(x)-g(x))$ so $f(x)-g(x)=r(x)p(x)$ for some $r(x)\in K[x]$. Therefore $g(x)-f(x)=-r(x)p(x)$ and so $g(x)\equiv f(x)$.
Transitivity Assume $f(x)\equiv g(x)$ and $g(x)\equiv h(x)$. Then $f(x)-g(x)=r_1(x)p(x)$ and $g(x)-h(x)=r_2(x)p(x)$ so that
$$
f(x)-h(x)=r_1(x)p(x)+r_2(x)p(x)=(r_1(x)+r_2(x))p(x)
$$
hence $f(x)\equiv h(x)$.

As an aside, the proof is exactly the same if you consider $R$ any commutative ring, $p\in R$ and define $a\equiv b$ if and only if $p\mid(a-b)$ (that is, $a-b=rp$ for some $r\in R$).
The condition is exactly the same as saying $a-b\in (p)$ (the principal ideal generated by $p$). More generally, if $I$ is an ideal of $R$, the relation $a\equiv b$ if and only if $a-b\in I$ is an equivalence relation.
The assumptions that $p(x)$ has degree $n>1$ and that it is irreducible are completely redundant.
