Locally free sheaf which is not isomorphic to a constant sheaf. Let $\mathscr{F}$ be a sheaf of abelian groups. We say that $\mathscr{F}$ is a locally free sheaf if $\forall x \in X$ exists some $U \subset X$ such that $\mathscr{F}_U$ (restriction of $\mathscr{F}$ to U) is isomorphic to a constant sheaf with stalks $\mathbb{Z}^m$.
I've just proved that if $X$ is connected then the rank of $\mathscr{F}$ is well defined. But I need to find a locally free sheaf (with X connected) which is not isomorphic to a constant sheaf.
I don't know many examples so I'm stuck in this exercise.
 A: Since you're give no restrictions on your base scheme, you may as well consider sheaves on an affine scheme Spec $R$. Then you want to cook up a projective (ie, locally free) $R$ module which is not free.
One plentiful source of $R$ modules are the ideals of $R$. Lets try some examples.
Start with $R = \mathbb{Z}$. Then $R$ is a PID, so its ideals are all principal. For an ideal $I = (n)\subset \mathbb{Z}$ it's easy to see that it's free, so that's no good. In general it's not hard to see that principal ideals are all free of rank 1.
Alright, what's an easy example of a non-PID? Well, you could try $R = k[x,y]$, in which case there exist plenty of non-principal ideals - for example, take $I = (x,y)$. Is this free? Well, if it were free, then it would have to be rank 2, and an ``obvious basis'' would be $\{x,y\}$, but this is not $R$-linearly independent - on the other hand, any set of generators must certainly contain $\{x,y\}$, so we conclude that this is not free. Is it locally free? Localizing at the ideal $(x,y)$, it's easy to see that the same argument shows that it's not free over the localization either.
The problem here is that an ideal of a ring $R$ is free iff it is principal. Certainly principal ideals are free. Conversely, if $I$ is free with $x_1,x_2$ members of some basis, then $x_2x_1 - x_1x_2 = 0$ shows that they cannot be linearly independent, and hence any basis could only consist of one element, so $I$ is principal.
This would naturally lead one to consider the problem : Can you find ideals which are not globally principal, but are locally principal?
This is not hard if you know the analogy with geometry. Local rings of dimension 1 with principal maximal ideal are discrete valuation rings, and are precisely the local rings of closed points on a curve. Curves basically correspond to Dedekind domains, and so if your dedekind domain isn't a PID, then every nonprincipal maximal ideal in your domain is a locally free (of rank 1) module which is not free!
Easy examples include $k[x,y]/(y^2-x^3-1)$ and the ring of integers of some number field with class number $>1$.
EDIT: Just realized you might not know about schemes yet, so dang. Oh well, I guess you can explicitly construct such a sheaf by starting with a space $X$ with fundamental group $\pi_1(X)$. Consider the cyclic group $\mathbb{Z}/n\mathbb{Z}$ of order $n$, and have $\pi_1(X)$ act on $\mathbb{Z}/n\mathbb{Z}$ via any nontrivial homomorphism $\pi_1(X)\rightarrow Aut(\mathbb{Z}/n\mathbb{Z}) = (\mathbb{Z}/n\mathbb{Z})^\times$. By the Galois correspondence this data is equivalent to a degree $n$ covering space of $X$ whose sheaf of sections is naturally a sheaf of groups, which is not a constant sheaf if the action of $\pi_1(X)$ is nontrivial. However it is certainly locally constant. Okay sure the local sections aren't $\mathbb{Z}^m$, but you could just as well replace $\mathbb{Z}/n\mathbb{Z}$ with $\mathbb{Z}$. Then the local sections would be $\mathbb{Z}$, but the global sections would be the trivial group if the action of $\pi_1(X)$ is nontrivial.
