When two blocks are connected by a string passing over a pulley whose moment of inertia is given (means pulley is not massless) then why does the string not have same tensions? What will be the direction of friction while rotation, if any? (between string and pulley)
Problems that depict situations where the tensions are same on ropes on both sides of the pulley are ideal situations.It is stated so in order to minimize any complexities that may arise if the pulley was to rotate.Now, if the tensions were not equal on both sides, the pulley would experience a net non-zero torque and hence a net angular acceleration and eventually rotate.Also,these are cases where pulleys have friction between its rim and the rope..if there were no friction on the rope-rim interface the pulley would not turn and its mass would become irrelevant .
Because the pulley possesses mass, you need to apply a non-zero net torque to it to increase its angular acceleration (assuming that is the goal here). If the tensions were the same on both sides of the contact point between the string and the pulley, there would be no angular acceleration.
It can be understood as follows that the tensions in the strings at both ends are different because of friction between the strings and pulley which is enabling the pulley to rotate along with the string. Moreover if the tensions were same no net torque would act and sysem wil remain stationary... (Tensions in both the strings will be same if there were no friction and the string would have simply slipped without any rotation in the pulley and would have no relevation with mass of the pulley or its moment if inertia .) .