rank function on Spec (help with definition) one definition of the line bundle over a ring is: a finitely generated projective A-module such that the rank function Spec A → N (positive integers) is constant with value 1. We call A itself the trivial line bundle.
so here i think that spec is equipped with zariski topology and N with the discrete one. Does this mean that in general the rank function is not continuous? Does one know about a basic example of non constant rank function to illustrate the peculiarities implied by the definition above?
Many thanks

I am only going to talk about the case that $A$ is Noetherian. 
Here is part of Theorem A3.2 of Eisenbud's "commutative algebra with a view toward Algebraic geometry": a finitely generated module $M$ over a noetherian ring $A$ is projective if and only if there exists a finite set of elements $x_1,\ldots, x_r$ in $A$ that generates the unit ideal of $R$ such that $M[x_i^{-1}]$ is free over $A[x_i^{-1}]$ for each $i$.  
It follows that the rank is a locally constant function. So if $\mathrm{Spec}(A)$ is connected, then the rank has to be constant. 
I'll leave it to you to construct an example of a projective module with nonconstant rank. 
