Solution (source code)

= Solution

Since $M$ is a <finitely generated module>, choose a surjection from a finite <free module>, $F_0\twoheadrightarrow M$. A finite <free module> over a <left Noetherian ring> is a <Noetherian module>, so the kernel $K_1$ is finitely generated. Choose a finite <free module> $F_1$ surjecting onto $K_1$, then compose its map with $K_1\hookrightarrow F_0$. Its kernel is again finitely generated. Repeating constructs an exact sequence
$$
\boxed{\cdots\longrightarrow F_2\longrightarrow F_1\longrightarrow F_0\longrightarrow M\longrightarrow0,}
$$
with all $F_i$ finite <free modules>, hence <finitely generated projective modules>. Thus the requested <projective resolution> exists, without asserting that it has finite length.

Assume now that $M\ne0$ and $\operatorname{pd}_RM=n<\infty$. We may arrange a length-$n$ <projective resolution> with all terms finite projective. Here is why the preceding construction gives one. Set $K_0=M$, with short exact sequences $0\to K_{j+1}\to F_j\to K_j\to0$. Applying the <Ext functor>, whose positive degrees vanish on a projective first argument, gives by repeated dimension shifting
$$
\operatorname{Ext}^1_R(K_n,N)\cong\operatorname{Ext}^{n+1}_R(M,N)=0
$$
for every left <module> $N$. The final equality follows from the existence of any length-$n$ <projective resolution>. Vanishing of these degree-one groups means that every short exact sequence ending in $K_n$ splits: its extension class is zero. In particular a free surjection onto $K_n$ splits, so $K_n$ is a <projective module>. It is finitely generated by the <Noetherian> kernel construction. Use $P_n=K_n$ and $P_j=F_j$ for $j<n$ to obtain
$$
0\longrightarrow P_n\xrightarrow{d_n}P_{n-1}\longrightarrow\cdots\longrightarrow P_0\longrightarrow M\longrightarrow0.
$$
For a left <finite projective module> $P$, put $P^*=\operatorname{Hom}_R(P,R)$, a right <module> under $(fr)(p)=f(p)r$. It is a right <finite projective module>, and its natural evaluation map
$$
P\longrightarrow P^{**}=\operatorname{Hom}_{R^{\mathrm{op}}}(P^*,R),\qquad p\longmapsto(f\longmapsto f(p)),
$$
is an <isomorphism>. These claims hold for a finite <free module> by coordinates, and pass to <direct summands>, proving them for every <finite projective module> without any right-Noetherian hypothesis.

Suppose $n\geq1$ and $\operatorname{Ext}^n_R(M,R)=0$. Computing the <Ext functor> from this resolution shows that its last dual map
$$
d_n^*:P_{n-1}^*\longrightarrow P_n^*
$$
is surjective. Since $P_n^*$ is projective as a right <module>, this map has a right-module section $h:P_n^*\to P_{n-1}^*$, with $d_n^*h=1$. Dualizing gives $h^*d_n^{**}=1$. Under the natural double-dual identifications, $d_n^{**}$ is $d_n$, so this gives a left-module retraction of $d_n$.

Therefore $P_{n-1}=d_n(P_n)\oplus Q$ for a <finite projective module> $Q$. The next differential has kernel $d_n(P_n)$, so restricting it to $Q$ gives an exact resolution with $Q$ replacing $P_{n-1}$ and the initial $P_n$ removed. This has length $n-1$, contradicting the definition of <projective dimension>. For $n=0$, the nonzero $M$ is a <finite projective module> and a summand of some $R^d$. A nonzero vector in that summand has a nonzero coordinate, so one coordinate projection restricts to a nonzero map $M\to R$. Thus the degree-zero <Hom functor> is nonzero as well. We have proved
$$
\boxed{\operatorname{Ext}^n_R(M,R)\ne0.}
$$
This is <top Ext detects finite projective dimension over a left Noetherian ring>. The nonzero-module convention matters when $n=0$: if one assigns projective dimension zero to the zero module, then $\operatorname{Hom}_R(0,R)=0$ is an exception. With the convention $\operatorname{pd}_R0=-\infty$, it is outside the asserted finite nonnegative case.

For an example of infinite <projective dimension>, take the <dual numbers> $R=k[\varepsilon]/(\varepsilon^2)$ over a <field> $k$, and $M=k=R/(\varepsilon)$. The <periodic resolution over dual numbers> is
$$
\cdots\xrightarrow{\varepsilon}R\xrightarrow{\varepsilon}R\xrightarrow{\varepsilon}R\longrightarrow k\longrightarrow0.
$$
It is exact because both the kernel and image of multiplication by $\varepsilon$ are the ideal $(\varepsilon)$, and that is also the kernel of $R\to k$. Applying $\operatorname{Hom}_R(-,k)$ gives a copy of $k$ in every degree and zero differentials, since $\varepsilon$ acts as zero on $k$. Consequently
$$
\operatorname{Ext}^j_R(k,k)\cong k\ne0\qquad\text{for every }j\geq0.
$$
A finite <projective resolution> would make these groups zero above its length, so
$$
\boxed{\operatorname{pd}_{k[\varepsilon]/(\varepsilon^2)}k=\infty.}
$$