Sign Convention for Bending Moment (BM):
At this sections, where the bending moment is such that this tends to bend the beam at that point to a curvature with concavity at the top as illustrated in Figure (b) is taken as +ve, and where the bending moment is such that it tends to bend at that point to a curvature along convexity at the top as illustrated in Figure (b) is taken as negative.
Alternatively, a loading which causes the beam to hog, shall create negative bending moment, a loading that causes the beam to sag, shall create positive bending moment.
Figure: Sign Convention for Bending Moment (BM)