Tensor product of a module and a projective module. Suppose that i have a commutative ring $R$ and $R$-modules $M$ and $N$ such that $M$ and $M\otimes_R N$ are finitely generated projective modules.
 Suppose also that $ {\rm rk}_R(M)={\rm rk}_R(M\otimes_R N).$ 
Is it true that $N$ is a projective finitely generated module?
 A: Let $R=A\times B$ be a product of two rings, $M=A\times \{ 0 \}$ and $N$ any $B$-module viewed as $R$-module via the projection $R\to B$. Then $M$ is projective over $R$, $M\otimes_R N=0$. But you can't conclude that $N$ is projective. 
You should suppose that $M_p\ne 0$ for any prime ideal $p$ of $R$. 
Edit Positive answer under the above condition. Note that the condition on the ranks is not sufficient as shows any example with $M=0$. 
What is important is that $M$ is faithfully flat. This is true because it is flat by projectivity and faithfully flat by the condition $M_p\ne 0$ for all prime ideal $p$ of $R$. 
Now suppose $M\otimes N$ is projective. Let us prove first that $N$ is flat: let $N_1\to N_2$ be an injective $R$-linear map. Let $L$ be the kernel of $N_1\otimes N\to N_2\otimes N$. Then $L\otimes M=0$ because $M$ and $M\otimes N$ are flat. By faithfull flatness of $M$, this implies that $L=0$. Hence $N$ is flat. 
Fact. Let $K$ be any $R$-module such that $M\otimes_R K$ is finitely generated. Then $K$ is finitely generated. 
Proof: $M\otimes K$ has a finite generating family of the form $m_i\otimes k_i$ with $k_i\in K$ and $m_i\in M$. If $K'$ is the submodule of $K$ generated by the $k_i$'s, then $M\otimes K'=M\otimes K$, hence $M\otimes (K/K')=0$. Again by faithfull flatness of $M$, this implies that $K/K'=0$ and $K=K'$ is finitely generated. 
Applying this fact to $N$, we see that $N$ is finitely generated. Let $R^n\to N$ be a surjective $R$-linear map with kernel $P$. We have an exact sequence 
$$ 0\to M\otimes P\to M^n \to M\otimes N\to 0.$$ 
As $M\otimes N$ is projective, this exact sequence splits and $M\otimes P$ is a direct summand of $M^n$, hence finitely generated. By the above fact, 
$P$ is finitely generated. 
So $N$ is flat and finitely presented. It is known that this condition is equivalent to be projective (and finitely generated).  
