I used NAKAYAMA for one side of this problem, but for the other part I don’t know what to do, could you please help me ?
$R$ is a local ring with the maximal ideal $\mathfrak{m}$, $M$ is an $R$-module. M is fg $$\text{Hom}_R(M,R/\mathfrak{m})=0 \quad \Longleftrightarrow \quad R/\mathfrak{m}\otimes_R M=0.$$
If $R/\mathfrak m\otimes_R M$ is not zero, then there is a nonzero morphism $f:R/\mathfrak m\otimes_R M\to R/\mathfrak m$, since these are all vector spaces over the field $R/\mathfrak m$. Define $g:M\to R/\mathfrak m$ setting $g(x)=f(1\otimes x)$ for all $x\in M$: this is a nonzero morphism $M\to R/\mathfrak m$.
Conversely, if $h:M\to R/\mathfrak m$ is a nonzero morphism, so that $\hom(M,R/\mathfrak m)\neq0$, then there is an $x_0\in M$ such that $h(x_0)\neq0$ in $R/\mathfrak m$. There is a map $k:R/\mathfrak m\otimes_R M\to R/\mathfrak m$ such that $k(a\otimes x)=af(x)$ for all $a\in R/\mathfrak m$ and all $x\in M$, and this map is nonzero, since $k(1\otimes x_0)\neq0$. It follows, of course, that $R/\mathfrak m\otimes_RM$ is not zero.