In an ideal and linearly stretched rope, the tension is the same throughout its length, so that the rope won't have infinite acceleration. This means that if I draw a free body diagram of a infinitely small piece of the rope, I will have to show two tension forces of same magnitude and in opposite directions, cancelling each other.
My question is how to use this reasoning to explain that the free body diagram of a pulley in problems where the rope is stretched around one is usually drawn like the one of pulley A in this image:
Based on the assumptions that the ideal pulley has a circular shape and that the tensions continue to cancel each other on every point of the segment of the rope that is around the pulley, I made the following reasoning: for every point of the rope that is in contact with the pulley, there are two tension forces that cancel each other and that have a slope that is equal to the tangent of the circle determined by the pulley at that point.
However, this simply means that the rope continues to have zero net force and doesn't explain how it exerts a force of $2T$ on the pulley, which is cancelled by the force of $2T$ exerted by the clamp. So, again, how does the rope interact with the pulley and exert this $2T$ force? Can I show it exerts this force of $2T$ by some form of integration over all points of the rope that are in contact with the pulley? Am I wrong in my assumptions? I considered the possibility of the pulley exerting a normal force on the rope since this would mean, by Newton's Third Law, that the rope exerts a force on the pulley, but can a normal force exist if the rope has negligible mass?