On subring $R\subseteq S$ such that the inclusion map $i: R\to S$ splits as an $R$-module map Let $R\subseteq S$ be commutative rings in the sense that $R$ is a subring of $S$ with the same unity. So canonically, $S$ has an $R$-module structure.  We say that the inclusion map $i: R\to S$ splits as a map of $R$-modules iff there exists an $R$-module map $f: S\to R$ such that $f\circ i=id_R$ (i.e. $f(r)=r, \forall r\in R$). Since $f$ is an $R$-module map so $f(r)=r,\forall r\in R$ is same as saying $f(1)=1$. 
Now my question is: if for some $R$-module $M$, we have an isomorphism of $R$-modules $S\cong R\oplus M$, then is it true that the inclusion map $i:R\to S$ splits ?  
(Note that I'm not specifying anything about how the isomorphism $S\cong R\oplus M$ looks like ...) 
My try: If $\phi : S\to R\oplus M$ is the isomorphism, then the natural candidate for $f: S\to R$ is $f=\pi_1\circ \phi$ , where $\pi_1:R\oplus M\to R$ is the canonical first coordinate surjection. But I'm unable to see why $f(1)=1$ with this choice of $f$ . 
Please help. 
Added Notes: the existence of an $R$-linear isomorphism $\phi: S\to R\oplus M$ gives rise to an induced exact sequence $0\to R\xrightarrow{\phi \circ i} R\oplus M \xrightarrow{\pi_2} M\to 0$ . Now this sequence splits if there exists an $R$-linear map $f:S\to R$ with $f(1)=1$ i.e. if $R$ is a direct summand of $S$ in our sense . Indeed if $f:S\to R$ is $R$-linear with $f(1)=1$, then $f\circ \phi^{-1}: R\oplus M\to R$ gives the required map for splitting the above sequence. 
 A: The answer is NO. 
Let $S=\mathbb{Z}[\dfrac{1+\sqrt{-3}}{2},\sqrt{2}]$ and $R=\mathbb{Z}[\sqrt{-6}]$.
One may show that $S=R\dfrac{1+\sqrt{-3}}{2}\oplus (\sqrt{-3}R+\sqrt{2}R)$.
This can be done (rather tediously) by hand, or you can notice that $S$ is the ring of integers of  $E=\mathbb{Q}(\sqrt{-6},\sqrt{-3})$ and $R$ is the ring of integers of $F=\mathbb{Q}(\sqrt{-6})$, and apply theorem 3.1 of  https://kconrad.math.uconn.edu/blurbs/gradnumthy/notfree.pdf with $d=2$ and $q=3$.
If you want a quicker argument, you could say that $R$ is a Dedekind ring (it is the ring of integrs of $F$), and $S$ is a finitely generated  $R$-module (since it is already finitely generated of $\mathbb{Z}$) which is torsion free. It is then well-known that such a module is isomorphic to $R^{k-1}\times I$, where $I$ is a nonzero ideal of $R$, where $k$  is the rank (it is known that a torsion free finitely generate $R$-module is a projective of constant rank, so the rank is defined.)
So in our case, whichever method you choose, you find that  $S\simeq R\times M$, for some $R$-module $M$. 
It remains to show that $R$ is not a direct summand of $S$, which is equivalent to say that there is no $R$-linear map $f:S\to R$ such that $f(1)=1$. Note that such a map is $\mathbb{Z}$-linear since it is $R$-linear.
We are going to exploit the fact that $1,\dfrac{1+\sqrt{-3}}{2}, \sqrt{2},\sqrt{2}\dfrac{1+\sqrt{-3}}{2}$ is a $\mathbb{Z}$-basis of $S$.
Let $a=f(\dfrac{1+\sqrt{-3}}{2}),b=f(\sqrt{2}),c=f(\sqrt{2}\dfrac{1+\sqrt{-3}}{2}).$
We have $\sqrt{-6}\dfrac{1+\sqrt{-3}}{2}=\dfrac{\sqrt{-6}-\sqrt{18}}{2}=\sqrt{2}\dfrac{\sqrt{-3}-3}{2}=\sqrt{2}(-2+\dfrac{1+\sqrt{-3}}{2})$, so $$\sqrt{-6}a=-2b+c. \ \  (1)$$
We have $\sqrt{-6}\sqrt{2}=2\sqrt{-3}=2\dfrac{1+\sqrt{-3}}{2}-1$, so $$\sqrt{-6}b=2a-1.\ \  (2)$$
We have $\sqrt{-6}\sqrt{2}\dfrac{1+\sqrt{-3}}{2}=\sqrt{2}\sqrt{2}(-2+\dfrac{1+\sqrt{-3}}{2})=-4+2\dfrac{1+\sqrt{-3}}{2}$, so $$\sqrt{-6}c=-4+2a.\ \  (3)$$
Multipliying $(1)$ by $\sqrt{-6}$ and using $(2)$ and $(3)$, we get $-6a=-2(2a-1)-4+2a$, that is $a=\dfrac{1}{2}\notin R$, and $f$ does not exist.
