I do not understand why buying and selling stock on days gives the maximal profit,
why buying stock on day i and selling the stock on day j where j  i > 1 is not possible to be better than this way? Is there a proof？
Why buying and selling stock on i and i +1 gives the maximal?

Say a sequence from i to j, if it is in a nondecreasing order, then the highest profit will be achieved by buying at day i and sell at day j. It's the same as you buy 1 and sell in the next day. If, it is NOT in a nondecreasing order, say at day k, the price goes down. Then you can always sell the share at day k1, and buy 1 at day k to obtain even more profit.
So to sum up, you will earn the max profit from the sum of each nondecreasing segment. The 2 ways to achieve the max profit are essentially the same, but the second one is easier to implement.