Let $M$ be a finitely generated projective module over a commutative ring $R$ with finitely maximal ideals. Also assume that $M$ has constant rank i.e. rank of $M_P$ as $R_P$-module remains constant as $P$ varies over all prime ideals of $R$. How to show that $M$ is free ?
I'm allowed to assume that finitely generated projective modules over local rings are free.
My try: Let $J$ be the Jacobson radical of $R$. Then $R/J$ is a finite direct product of fields. Now $M/JM$ is a projective $R/J$-module. Now I'll be done if I can show $M/JM$ is free over $R/J$. Unfortunately I'm unable to show this last part.
Please help.