Example (pairwise independent events but not independent)
Consider $\Omega=\set{1,2,3,4}$ with equally likely outcome.
Let events $$ A_1=\set{1,2}, \quad A_2=\set{2,3}, \quad A_3=\set{1,3}. $$
Can easily check that $$\mathbb P(A_i\cap A_j) = \frac14 = \mathbb P(A_i) \mathbb P(A_j)$$ so they are pairwise independent.
But $$\mathbb P(A_1\cap A_2\cap A_3) = 0 \neq \frac18 = \prob(A_1)\prob(A_2)\prob(A_3)$$ so they are not independent.