What's the reasoning behind assigning a proposition to a set, like $A=p(x)$ and $B=q(x)$? What's the reasoning behind assigning a proposition to a set, like $A=p(x)$ and $B=q(x)$? Is it because any set of elements has some property that defines all elements in it?
$$
\begin{align*}
A \cup (B \cap C) &= \{x|p(x) \vee (q(x) \wedge r(x))\}= \\\
&= \{x| (p(x)\vee q(x)) \wedge (p(x) \vee r(x)) \} \\\
&= \{x| p(x) \vee q(x)\} \cap  \{x|p(x) \vee r(x) \} \\\
&= (A \cup  B) \cap (A \cup C)

\end{align*}
$$
How exactly it works to prove things like this?
 A: Firstly I want to make clear that the only way to ensure that every set has a property defining it is some trivial property like $A = \{x|x\in A\}$, because there are sets which you cannot define by a simple formula just like that.
Now, to prove equality of sets, one usually shows that both the left hand side is included in the right hand side, and vice versa.
For example, you take some arbitrary $x\in A\cup (B\cap C)$ and then that means either $x\in A$ or $x\in B\cap C$ that is either $p(x)$ or both $q(x)$ and $r(x)$, that means that $p(x) \vee q(x) \wedge r(x)$ is true, from here you need to either prove it directly or by DeMorgan's laws show that this is equivalent that $(p(x) \vee q(x)) \wedge (p(x) \vee r(x))$ and from here follows that $x\in A\cup B$ and $x\in A\cup C$, that is to say $x\in (A\cup B)\cap (A\cup C)$.
A: As Asaf said, not all sets have a good definition.  But many of the ones we care about do.  In your example, you did not make use of the definition of A as $\{x|p(x)\}$, so could bypass that step and not even define it.  But it is often useful, as when we want $A\cap B$ we can look at p(x) and q(x) and ask what would x have to be to satisfy both.
