This is from The Probabilistic Method by Alon (pg 11). I understand the entirety of this proof except for the very end. It says, "This $A$ is clearly sum-free, since, if $a_1 +a_2 = a_3$ for some $a_1, a_2, a_3 \in A$, then $xa_1 + xa_2 ≡ xa_3(\text{mod } p)$, contradicting the fact that $C$ is a sum-free subset of $Z_p$."
I get that of course $a_1 + a_2 = a_3$ implies $xa_1 + xa_2 ≡ xa_3(\text{mod } p)$, but I don't see how $xa_1 + xa_2 ≡ xa_3(\text{mod } p)$ contradicts the fact that $C$ is a sum-free subset of $Z_p$.
It seems to me that if we could show that $(xa_1)\text{mod } p + (xa_2)\text{mod } p = (xa_3)\text{mod } p$, that would be a contradiction since all three of the terms in this statement are in $C$. But $xa_1 + xa_2 ≡ xa_3(\text{mod } p)$ doesn't imply $(xa_1)\text{mod } p + (xa_2)\text{mod } p = (xa_3)\text{mod } p$ as far as I can tell.
Your concern is correct, in that the statement in your second paragraph doesn't imply the statement in your third one. However, in the proof, what Erdos means when he says that $C$ is a sum-free subset of $Z_p$ is that $C$ is sum-free with respect to the addition inside $Z_p$, i.e. that we cannot have $x + y \equiv z \mod p$ for any $x, y, z \in C$. He's using "sum-free" to mean sum-free with respect to the group operation, not just addition of residue class representatives.
Can you see why $C$ is sum-free in this stronger sense?