Consider a simple situation where a round body is rolling up an incline plane and hence it is under the influence of gravity...
My physics teacher says that to identify the direction of friction, we should imagine a situation where there is no friction, identify where the slipping occurs and the friction will act oppose the slipping.
This works when the body is slipping down an incline because then the friction acts up the incline which makes sense because its torque supports the increasing angular velocity due to gravity.
But in case of pure rolling up an incline it is seen that friction again acts up the incline. But if we imagine a situation without friction it is seen that the bottommost point slips up the incline and to ensure that pure rolling occurs, the friction must act down the incline so that the bottommost point is at rest w.r.t the incline.
So why does friction act up the incline if a body is pure rolling up an incline under the influence of gravity?