Here is Canvas object wihch demonstrate the problem.

Consider a short length of the beam just to the left of B. Let the length of this segment be Δx.

On the left-hand side (a) of the segment, a bending moment M acts as shown. On the right-hand side (b), the moment is just a little bit larger, M + ΔM.