Answer
See a detailed answer below.
Work Step by Step
a) Since the pulley and the string are massless and since the pulley is rolling without friction, the tension force in the wire connecting them is constant.
Now we need to find the acceleration of the system [the two blocks].
We assume that the rope that connects the two blocks is nonstretchable, so the two blocks must have the same acceleration magnitude but one is accelerating east while the other is accelerating downward.
So we have to apply Newton's second law on the first block. We chose right to be the positive direction.
$$\sum F_x=T=m_1a$$
$$T=m_1a\tag 1$$
Now we need to apply Newton's second law on the second block. We chose downward to be the positive direction.
$$\sum F_y=m_2g-T=m_2a$$
$$m_2g-T=m_2a$$
Plugging $T$ from (1);
$$m_2g-m_1a=m_2a$$
Hence,
$$\boxed{a=\dfrac{m_2g}{m_1+m_2}}$$
Plugging into (1);
$$\boxed{T=\dfrac{m_1 m_2g}{m_1+m_2}}$$
----
b) The acceleration of both blocks is the same for the same reasons we mentioned above.
Now we need to apply Newton's second law on the first block. We chose right to be the positive direction.
$$\sum F_x=T_1=m_1a$$
$$T_1=m_1a\tag 2$$
Now we need to apply Newton's second law on the second block. We chose downward to be the positive direction.
$$\sum F_y=m_2g-T_2=m_2a$$
$$m_2g-T_2=m_2a$$
Thus,
$$m_2g-m_2a =T_2\tag 3$$
Applying Newton's second law on the pulley where we chose clockwise to be the positive direction.
$$\sum\tau=T_2R-T_1R=I\alpha$$
Hence,
$$T_2-T_1=\dfrac{I\alpha}{R}$$
where the moment of inertia of the pulley is as same as that for the disk $\frac{1}{2}MR^2$ where $R$ it the pulley's radius.
$$T_2-T_1=\dfrac{MR^{\color{red}{\bf\not} 2}\alpha}{2\color{red}{\bf\not} R}=\dfrac{MR\alpha}{2}$$
where $\alpha=a_T/R$ and $a_T$ here is equal to $a$.
Thus,
$$T_2-T_1= \dfrac{MRa}{2R}=\dfrac{M a}{2 }$$
$$T_2-T_1=\frac{1}{2}Ma$$
Plugging from (2) and (3);
$$m_2g-m_2a-m_1a=\frac{1}{2}Ma$$
$$m_2g=\frac{1}{2}Ma+m_2a+m_1a=a(\frac{1}{2}M +m_1 +m_2) $$
Therefore,
$$\boxed{a=\dfrac{m_2g}{\frac{1}{2}M +m_1 +m_2}}$$
Plugging into (2);
$$\boxed{T_1=\dfrac{m_1m_2g}{\frac{1}{2}M +m_1 +m_2}}$$
Plugging into (3);
$$ T_2=m_2g - \dfrac{ m_2^2g }{\frac{1}{2}M +m_1 +m_2} $$
$$\boxed{ T_2=m_2g\left[1- \dfrac{ m_2 }{\frac{1}{2}M +m_1 +m_2}\right] } $$
when $m_p=M=0$,
$$ a=\dfrac{m_2g}{0+m_1 +m_2}=\boxed{\dfrac{m_2g}{ m_1 +m_2}} $$
which is the same result in part [a] above.
$$ T_1=\dfrac{m_1m_2g}{ 0+m_1 +m_2} =\boxed{\dfrac{m_1m_2g}{ m_1 +m_2}}=T$$
which is also the same result in part [a] above.
$$ T_2=m_2g\left[1- \dfrac{ m_2 }{0 +m_1 +m_2}\right] $$
$$ T_2=m_2g - \dfrac{ m_2m_2g }{ m_1 +m_2} = \dfrac{ m_1m_2g+m_2m_2g -m_2m_2g }{ m_1 +m_2} $$
$$T_2=\boxed{\dfrac{m_1m_2g}{ m_1 +m_2}}=T $$
which is the same result in part [a] above.