Let $X$ be a topological space and $F$ a field. Suppose the singular cohomology of $X$, $H^n(X;F)$, is finitely generated in every dimension. In this case, by Künneth's formula: $$H^*(X\times X;F)\cong H^*(X;F)\otimes H^*(X;F),$$ we know that the cup product: $$\smile\colon H^*(X;F)\otimes H^*(X;F)\to H^*(X;F)$$ is induced by the diagonal map $\Delta\colon X\to X\times X$. I want to show that the kernel of the cup product is exactly the image of $(\pi_1^* - \pi_2^*)$, where $\pi_1,\pi_2\colon X\times X\to X$ are the projections.
The inclusion $\mathrm{Im}(\pi_1^* - \pi_2^*)\subseteq\ker\Delta^*$ is straightforward. However, I am having trouble showing the other inclusion. My attempt so far is the following: let $\gamma = \sum_{i,j} c_{ij} \alpha_i \otimes \beta_j \in \ker\Delta^*$. This means $\sum_{i,j} c_{ij} \alpha_i \smile \beta_j = 0$. Let $(e_k)$ be a graded base of $H^*(X;R)$. We can write: $$\alpha_i = \sum_k a_{ik} e_k, \quad \beta_j = \sum_l b_{jl} e_l.$$ By substituting in $\gamma$: $$\gamma = \sum_{i,j,k,l} c_{ij} a_{ik} b_{jl} \, e_k \otimes e_l$$ the condition $\Delta^*(\gamma) = 0$ means that: $$\sum_{k,l} \left( \sum_{i,j} c_{ij} a_{ik} b_{jl} \right) e_k \smile e_l = 0.$$ Can we deduce from here that $$\sum_{i,j} c_{ij} a_{ik} b_{jl} = 0, \quad \text{ for every } \, k,l\geq 1?$$ Then maybe we can use the fact that $e_k\otimes e_l-e_l\otimes e_k=(\pi_1^*-\pi_2^*)(e_k)\cdot e_l$? I don't really know how to justify this properly and continue from here. Any hint/reference is appreciated!