In accelerated rolling, why does friction act in direction of motion if a tangential force is applied? If the external force has a line of action through the center of mass then friction behaves as it does normally; backward to motion:

But, if the force's line of action does not pass through the center of mass.. then something strange happens:

The book I am referring to explains this by the idea that balances out torque created by the force on top to satisfy the condition of pure rolling but I don't understand how. How does the friction switch signs at the point of contact if the force acts tangentially? More specifically, what exactly happens at the point of contact for such a direction switch of friction?
It is said that the tangential force causes sliding in a backward direction but how can a forward force cause a backward sliding??

The textbook I'm using :
Physics for K-12, Sunil Kumar Singh
 A: In short, because the force is causing severe rotational torque, which tries to make the ball spin even faster than its current rotational speed. To spin even faster means that the contact point will slide; the bottom part of the ball will slide backwards. Static friction, which is a force that comes into existence to prevent sliding, has to pull forwards to prevent this sliding, this "wheel-spin".
When the force acts from the centre, it doesn't cause any additional torque. All torque which causes the rotation to speed up must thus be due due to friction. So friction has to pull backwards in this base to cause this clockwise rotational acceleration.
Somewhere between the centre and the top, static friction flips from backwards to forwards. In that particular point, the static friction is exactly zero, since the rotational acceleration is exactly caused by the applied force with no need for a friction force to aid it nor to slow slow it down. That flip happens to be right in between, so half a radius up from the centre. You can find this out simply by applying Newton's 2nd law of motion as well as the equivalent law for rotation.
A: There are 2 effects of the applied force, considering no slippage:

*

*$F_{net} =  F_{applied} - F_{friction} = ma$

*$T = I\frac{d\omega}{dt} = I\frac{d(v/r)}{dt} = I\frac{a}{r}$.

$T = (\frac{I}{mr})(F_{applied} - F_{friction})$
If the object is a massive roll: $I = \frac{1}{2}mr^2$
$T = \frac{r}{2}(F_{applied} - F_{friction})$
Now, we can verify some cases:
Looking for the situation when the friction force is zero, the torque in the roll is: $T = \frac{r}{2} F_{applied}$, or the lever arm must be half radius above the center.
On the other hand, if the applied force is at the center, the torque in the roll is only due to the friction force: $ T = rF_{friction}$:
$rF_{friction} = \frac{r}{2}(F_{applied} - F_{friction}) =>  F_{friction} = \frac{1}{3}F_{applied}$
Finally, if the applied force is at the upper point of the roll. We have to remember that in the expression:
$F_{net} =  F_{applied} - F_{friction} = ma$, a positive sign for the friction force means that it is backwards.
If that is true, the total torque is the sum of 2 terms:
$T = rF_{friction} + rF_{applied}$.
$rF_{friction} + rF_{applied} = \frac{r}{2}(F_{applied} - F_{friction}) => F_{friction} = -\frac{1}{3}F_{applied}$
We come to the conclusion that the friction force is negative. So the total torque is the difference of the terms, and the friction force is forwards.
