Let the amplitude of oscillation of $$m$$ and $$M$$ be $$x_{1}$$ and $$x_{2}$$ respectively.
a) From law of conservation of momentum,
$$mx_{1}=Mx_{2}$$ ...(1) [because only internal forces are present]
Again $$(1/2)kx_{0}^{2}=(1/2)k(x_{1}+x_{2})^{2}$$
[Block and mass oscillates in opposite direction, But $$x\rightarrow$$ stretched part]
From equation $$(1)$$ and $$(2)$$
$$\therefore x_{0}=x_{1}+\dfrac{m}{M}x_{1}=\left(\dfrac{M+m}{M}\right)x_{1}$$
$$\therefore x_{1}\dfrac{Mx_{0}}{M+m}$$
So, $$x_{2}=x_{0}=x_{0}\left[1-\dfrac{M}{M+m}\right]=\dfrac{mx_{0}}{M+m}$$ respectively.