It took me a moment to understand what you were doing! The problem you gave "Find the integral of (1- x)^3, from 0 to 1" can be done with a simple integration. But what you are doing is using the basic "Riemann sums" definition. Yes, if you divide the interval from 0 to 1 into n parts each part has length 1/n. And, at the right endpoint of the ith interval the function value is (1- i/n)^3 so the "area" of the thin rectangle there is (1- i/n)^3(1/n) and the entire area, and so the integral, is approximated by the sum.
No, i does not go from 1 to infinity- it goes from 1 to n and then, to get the actual integral, you take the limit as n goes to infinity.
You should have
\frac{1}{n}\sum_{i=1}^n \left( 1- 3\frac{i}{n}+ 3\frac{i^2}{n^2}- \frac{i^3}{n^3}\right)
\frac{1}{n}\sum_{i= 1}^n 1- \frac{3}{n^2}\sum_{i= 1}^n i+ \frac{3}{n^3}\sum_{i= 1}^n i^2-\frac{1}{n^4}\sum_{i= 1}^n i^3