Why is the generator of $H^0(S^n,\mathbb{Z})$ the identity of $H^*(S^n,\mathbb{Z})$? I know the cohomology ring $H^*(S^n,\mathbb{Z})\simeq\mathbb{Z}[X]/(X^2)$, but the computation of this uses that fact that a generator of $H^0(S^n,\mathbb{Z})$ is the identity for the cohomology ring $H^*(S^n,\mathbb{Z})$. Why? 
It's known that $H^p(S^n,\mathbb{Z})\simeq\mathbb{Z}$ if $p=0,n$, and is $0$ otherwise. If $x$ generates $H^n(S^n,\mathbb{Z})$, then $x\cup x=0$ by degree considerations as the cohomology ring is graded.
If $e$ is a generator of $H^0(S^n,\mathbb{Z})$, then I want to have the relations $e\cup e=e$, $e\cup x=x$, $x\cup e=x$ and $x\cup x=0$. The explanation is the $e$ is the identity. 
I compute that if $\varphi\in H^m(S^n,\mathbb{Z})$, and $\sigma$ is an $m$-simplex, then
$$
(\sigma, e\cup \varphi)=(\sigma\lambda_0,e)(\sigma\mu_m,\varphi)=e(\sigma\lambda_0)\varphi(\sigma\mu_m)
$$
so it would be enough to know $e(\sigma\lambda_0)=1$, the actual integer $1$. Is there something I'm overlooking?
Edit: $\lambda_i,\mu_i\colon \Delta^i\to\Delta^d$ are the front-face and back-face maps, respectively defined by 
$$
\lambda_i\colon(t_0,\dots,t_i)\mapsto(t_0,\dots,t_i,0,\dots,0)
$$
and
$$
\mu_i\colon(t_0,\dots,t_i)\mapsto(0,\dots,0,t_0,\dots,t_i).
$$
 A: Let me focus on the generators of $H^0$ of a path-connected space $X$. 
A $0$-cochain $f$ is group homomorphism from the free group generated by the $0$-simplices in $X$ —which are just the points of $X$— to $\mathbb Z$, and such a homomorphism is determined by its values on the generators. Now if $p$ and $q$ are two points of $X$, there is a path $\sigma:[0,1]\to X$ such that $\sigma(0)=p$ and $\sigma(1)=0$. This $\sigma$ is a $1$-simplex in $n$; if $\delta f$ is the coboundary of $f$, we have $\delta f(\sigma)=f(\partial \sigma)=f(q)-f(p)$. It follows that if $f$ is a cocycle, so that $\delta f=0$, we have $f(p)=f(q)$ for all $p$ and $q$ in $X$. We thus see that the abelian group of $0$-cocycles can be identified to $\mathbb Z$: each such cocycle takes precisely one value on all $0$-simplices, and we can identify it to that value.
It follows at once from this (because there are no non-zero $0$-coboundaries) that one of the two generators of $H^0(X)$ are the $0$-cochains which map all $0$-simplices to $+1$, and the other maps them all to $-1$.
Now your $e$, which you described simply as «a generator of $H^0$» hasto be one of these two, but you can clearly see that you have to pick it correctly for whar you want to be true.
