Proving a function $\mathbb{Z}_m \to \mathbb{Z}_m,\ [a] \mapsto [a^2 + 3a + 1]$ is well defined 
Prove that $\operatorname{poly}\colon \mathbb{Z}_m \to \mathbb{Z}_m$ given by $\operatorname{poly}\colon [a] \mapsto [a^2 + 3a + 1]$ is well defined.


This is what I have so far, working in (mod m)
i.e. if $a' \equiv a$ then $a'^2+3a'+1 \equiv a^2 + 3a + 1$. ( need to prove)
Since $a' \equiv a$, there exists $d$ such that $dm = a' -a$
Not sure where to go from here, any tips?

So in your expression $a′^2 +3a ′ +1$, replace $a'$ with $a+dm$, and factor out.  What you should get should be congruent to $a^2 +3a+1$ (mod $m$).
