Whoops. I forgot the factor of two. It should be the following:

Here is the explanation of this formula: the LHS is merely a symbol representing, in this case, the area under all the piecewise linear functions (another way to think of it: it's the sum of all the areas of the trapezoids).

The RHS of this formula shows you how to compute that area. To get this formula, merely note that the width of each trapezoid is equal to the width of the whole interval divided by the number of intervals, which is

Now, the area of the jth trapezoid is given by (merely translating the formula you gave me):

You can think of this expression as the width times the average of the heights on the right and left sides of the subinterval. Does this make sense?

Now, if I add all those areas up, I get this:

All the middle terms are in the sum twice, and the endpoints are there only once.

Does this make the formula clear to you?