Kuiper, The first part is correct and complies with the general formula for a 2 block stack where the bottom block (7kg) is on a frictionless surface i.e., there is no static friction hence µ = 0.
General formula for maximum force F on frictionless surface;
F = µ m2 g (1 + m1/m2) Newtons
Where static friction µ = 0.3, m2 = 3kg , m1 = 7kg and g = 10m/s²
Thus 0.3 x 3kg x 10m/s² (1 + 7kg/3kg) = 30 N
This leads to maximum acceleration before slippage occurs of 3 m/s² as you have correctly calculated.
Where you have gone wrong is to assume the Frictional Force (horizontal vector) is acting Left to Right. The problem is rather intuitive and upon reassessing you’ll see the horizontal vector must be acting from Left to Right. NB: It will alternate in direction as you go up the stack.
One further amendment that is required, not to assume your Frictional Force (correct in the first part) is of the same amplitude for the second part of the question.
Hope this helps.