The shear force (f) is continuous through the element length, but since forces can be added at the nodes, the force may be discontinuous across the element interfaces as shown in the shear diagram below where an external force is added at node 2.

The shear force will be continuous between elements if no external forces are added at shared nodes, as in the figure below.

A FEM solution for this situation will give us shear forces that are equal in magnitude and opposite in direction at the I and J nodes of each element as shown in the free body diagram below.

The shear force diagram for this situation is shown below, where the diagram starts with a magnitude of f1 in the negative direction and then goes back to zero as at node 2 in element 1. In element 2 the diagram goes negative by a magnitude of f2, since no external force is added at node 2, f1 = f2 resulting in a continuous shear force across the element interface. Finally the diagram goes back to zero at node 3 where f3 is directed in the positive direction and is equal in magnitude to f1 and f2.

Normally the above example would be modeled with one element, since no force or moment are applied at the shared node.