Let $P$ be the set of all polynomials over $\mathbb{R}$. You have the relation $\sim$ defined on $P$ by $p\sim q\text{ if and only if }p(0)=q(0)\;.$
The thing to notice about this definition is that it boils down to the relation of equality between things associated with $p$ and $q$, and equality is the prototypical equivalence relation. Checking reflexivity, symmetry, and transitivity is therefore very easy, because they all boil down to reflexivity, symmetry, and transitivity of equality. For instance, if $p\sim q$ and $q\sim r$, then $p(0)=q(0)$ and $q(0)=r(0)$, so by transitivity of equality we have $p(0)=r(0)$ and hence $p\sim r$. Similar arguments work for the other two properties.
Note that essentially the same argument would have worked equally well for the relation $p\sim q$ if and only if $p(5)=q(5)$, say; just replace $0$ by $5$ everywhere, and the argument goes through word for word.
Here’s another example. Suppose that $X$ is some set, and $f:X\to Y$ is some function. Define a relation $\sim$ on $X$ by $x\sim y$ iff $f(x)=f(y)$. Checking that $\sim$ is an equivalence relation on $X$ is again easy, because $x\sim y$ reduces to the equality of things associated with $x$ and $y$. For symmetry, for instance, if $x\sim y$, then $f(x)=f(y)$, so of course $f(y)=f(x)$ (since equality is symmetric), and therefore $y\sim x$. Transitivity is almost as easy: if $x\sim y$ and $y\sim z$, then $f(x)=f(y)$ and $f(y)=f(z)$, so $f(x)=f(z)$, and therefore $x\sim z$. Notice how very similar this is to the proof of transitivity of the relation in your problem.
Even when a relation $\sim$ is not defined in a way that easily reduces to equality, there is a standard way to approach the problem of proving that $\sim$ is transitive, say. You want to show that if $x\sim y$ and $y\sim z$, then $x\sim z$, so start by assuming that $x\sim y$ and $y\sim z$. Then translate these two assertions into more fundamental statements about $x,y$, and $z$ using the definition of $\sim$, as I did in my examples. Use those new statements to prove (somehow!) that $x$ and $z$ have the required relationship. In your problem this was easy, because you were basically working with equality; in other problems it might be harder, even a lot harder, but this is still the way to begin.