Suppose we have a (commutative) ring $R$ and an $R$-algebra $S$. Furthermore, suppose that $S\cong R^n$ as $R$-modules, that is, $S$ is free of rank $n$ as an $R$-module. Can we always choose $1$ to be a basis element for $S$? Equivalently, is it necessary that $S/R \cong R^{n-1}$?


If not, how about in the case that $R=\mathbb{Z}$?


This is true in the case $n=1$: if we have a ring homomorphism $\phi: R\to S$ and an $R$-module isomorphism $\psi: S\to R^1$, it's not hard to show that $\phi$ must also be an isomorphism, making $S/R\cong R^0$.


And it is true if $n=2$ and $R=\mathbb{Z}$: in that case it is known that $S\cong \mathbb{Z}[x]/p(x)$, where $p$ is some degree 2 monic polynomial, so that in particular $S$ is generated freely as a $\mathbb{Z}$-module by 1 and $x$.



Does $S$ being a free rank-$n$ $R$-algebra imply that $S/R$ is free rank $n-1$?
This is not true in general. For example, assume that $P$ is a projective module on $R$ that is not free, but such that $P \oplus R$ is free (there are many such examples). Set $S= R \oplus P$, and give $S$ an $R$-algebra structure by taking the products of two elements of $P$ to be 0.


On the other hand, it is true when $R$ is a Dedekind domain (so, in particular, for $R = \mathbb Z$). Let us show that $S/R$ is torsion-free. If not, there would be some $s \notin R$ and $a, b \in R$, $a ≠ 0$, such that $as = b$. On the other hand $S$ is integral over $R$, so there is a relation $s^n + a\_1 s^{n-1} + \dots + a\_{n-1}s + a\_n = 0$, with all the $a\_i$ in $R$. Multiplying this by $a^n$ gets you a relation in $R$; by dividing this by $a^n$ in the quotient field $K$ of $R$ shows that $r := b/a \in K$ is integral over $R$. Since $R$ is normal we have $r\in R$, and $as = ar$. Since multiplication by $a$ is injective in $S$ we see that $s =r$ is in $R$, and this is a contradiction. 


So $S/R$ is torsion free and finite; hence it is projective, and $S$ is isomorphic to $R \oplus (S/R)$ as an $R$-module. But over a Dedekind domain every stably free module is free, and this concludes the proof.


