In the example problem below, how were the signs of the torques at x = 0 and x = L found? At x = 0, the direction of pulley rotation is unspecified but the direction is assumed to be positive. And at x = L, if you use the right hand rule the torque is applied in the positive x direction but the author states that torque is negative by the right hand rule. Is this because the shaft is stationary and must supply the same torque in the opposite direction at x = 0 and x = L?
Yes, you are right.
If it helps try to imagine a horizontal spring with two equal masses at the two ends on a frictionless surface, vibrating about the center of mass of the system, which is at the middle of the length of the spring. They always have opposite and equal magnitude acceleration and velocity and displacement.