What "n" or "deltax" are you talking about? Does this problem specifically require you to use a "Riemann sum" approximation?

It should be easy to find the exact value "geometrically". For x= 0 to 2, the graph is a horizontal straight line, y= 2, so the "area under the curve" is the area of a square, 2 high and 2 wide. For x= 2 to 4, the graph is a straight line through (2, 2) and (4, 4). The area under that is the area of a trapezoid with "height" 2 (x= 2 to x= 4) and bases of length 2 (y= 0 to y= 2) and 4 (y= 0 to y= 4). If you don't want to use the formula for area of a trapezoid, note that drawing a horizontal line from (2, 2) to (4,2) divides that trapezoid into a 2 by 2 square and a right triangle with base of length 2 and height 2.