Proof by induction:
$$ P( \cup _{i=1}^n A_i)=\sum_{i=1}^n P(A_i) - \sum_{1 \leq i_1 < i_2 \leq n} P(A_{i_1} \cap A _{i2} ) + \sum_{1 \leq i_1 < i_2 <i_3 \leq n} P(A_{i1} \cap A_{i2} \cap A_{i3}) -...+(-1)^{n+1}P(A_1 \cap A_2 \cap ... \cap A_n)$$
I don't really understand the whole i1
For three sets (events), it is intuitively clear why the formula works: If we take the measure (probability) of the union then we count the pairwise intersections twice. So we subtract the measure (probability) of the intersections. But then we subtracted the measure (probability) of the triple intersection. So we have to add it.
If there are more sets (events) then you can argue the similar way. We added the measure of the pairwise intersections twice. So subtract them. But then we subtracted the measure (probability) of the triple intersections. So let's add them. But now we added the measure of the four-tuples of intersections. So subtract them...