In problem number 5.42 on p.302 of Homological Algebra text by Rotman it is asked to prove that every presheaf of abelian groups over a discrete space is a sheaf. However it looks to me that I have a counter example.
Let $X=\{x_1,x_2\}$ be endowed with discrete topology. Let $U_1=\{x_1\},U_2=\{x_2\}$ be the proper subsets of $X$. Let $\mathcal{P}$ be a presheaf defined by : $\mathcal{P}(U_1)=\mathbb{Z},\mathcal{P}(U_2)=\mathbb{Z},\mathcal{P}(X)=\mathbb{Z}\times\mathbb{Z}\times\mathbb{Z_2}$. Let the restriction map to $\mathcal{P}(U_1)$ be the projection on the first component, the restriction map to $U_2$ be the projection on the second component. Now pick any two elements $a\in\mathcal{P}(U_1), b\in \mathcal{P}(U_2)$. The elements $(a,b,0) $ and $(a,b,1)$ are distinct gluings of the chosen sections.
In fact there appear to be more examples. E.g. look at the presheaf of constant functions. This is a presheaf but not a sheaf as gluing may not be possible at all.
Am I making some mistake ? Thanks.
You're right, this is not true, and your example is a counter-example to the assertion. Even simpler is your example of a constant presheaf, say associated to $\mathbf{Z}$, where the group of sections over any non-empty open is $\mathbf{Z}$. Given $x\neq y$, $m\neq n\in\mathbf{Z}$ viewed as sections over $\{x\}$ and $\{y\}$, respectively, agree on the overlap (vacuously!), but there is no element of $\mathscr{O}(\{x,y\})=\mathbf{Z}$ which restricts to both $m$ and $n$.