To define your own function with the same properties that (e.g.) Plot has, there are several ingredients which I'll try to develop step by step:
Start by trying the simplest thing:
i0[fn_, intvl_] := Module[{},
p1 = Plot[fn, intvl];
p2 = Plot[fn^2, intvl];
GraphicsRow[{p1, p2}]];
Clear[x];
i0[x^2, {x, 0, 2}]

Why HoldAll is needed
But now we immediately get in trouble when we do
x = 1;
i0[x^2, {x, 1, 2}]
Plot::itraw: Raw object 1 cannot be used as an iterator.
This never happens if you just call Plot[x^2, {x,1,2}].
The reason is that Plot has attribute Holdall, and you correctly implemented that already:
SetAttributes[i, HoldAll];
i[fn_, intvl_] := Module[{},
p1 = Plot[fn, intvl];
p2 = Plot[fn^2, intvl];
GraphicsRow[{p1, p2}]];
x = 1;
i[x^2, {x, 0, 2}]

Using SyntaxInformation and declaring local variables
The next thing you'd want to do is to give the user some feedback when the syntax is entered incorrectly:
SyntaxInformation[i] = {"LocalVariables" -> {"Plot", {2, 2}},
"ArgumentsPattern" -> {_, _, OptionsPattern[]}
};
This causes the variable x to be highlighted in turquois when it appears as the function variable, telling us visually that the global definition x = 1 should have no effect locally. The OptionsPattern is in there just in case you decide to implement it later.
But how does one really ensure that the x is local? In the function so far, we're lucky because we pass all arguments on to Plot which also has attribute HoldAll, so that we don't have to worry about the global value of x = 1 creeping in before we give control to the plotting functions.
Where your approach fails
Things are not so easy in general, though. This is where your construction fails, because as soon as you write intvl[[1]] the evaluator kicks in and replaces x by 1. To see this, just try to add axis labels x, y to the second plot, and modify the first plot to show the passed-in function plus x:
i[fn_, intvl_] := Block[{var = intvl[[1]]},
p1 = Plot[fn + var, intvl];
p2 = Plot[fn^2, intvl, AxesLabel -> {var, "y"}];
GraphicsRow[{p1, p2}]];
x = 1;
i[x^2, {x, 0, 2}]

The first plot should show x^2 + x but shows x^2 + 1, and the second plot has horizontal label 1 instead of x. This happens because I've declared the global variable x = 1 and didn't prevent it from being used inside the function i. It's a somewhat artificial example, but I wanted to address the case where the independent variable really is needed by itself inside the function. When it appears as the first element of the second argument in i, a variable is supposed to be a dummy variable for local use only (that's how Plot treats it).
Wrapping arguments in Hold and its relatives
So we have to really make use of the HoldAll attribute of out function now, to prevent the variable from being evaluated.
Here is a way to do this for the argument pattern of the above example. The main thing is that it always keeps the external variable and function wrapped in Hold, HoldPattern or HoldForm so it never gets evaluated.
If you look at the Plot commands in the function i below, you'll see that I'm now using local variables: ii is the function, and localVar is the independent variable. This means I needed to replace the externally given symbol (say, x as above) by a new locally defined symbol localVar. To do that, I first need to identify the external variable symbol, called externalSymbol, from the first entry in the range intvl passed to the function. I chose to do this with a replacement rule that acts on Hold[intvl]and returns a held pattern that can be used later to replace the external variable in the given function fn by using the rule externalSymbol :> localVar. The result is the local function ii which I then plot using the minimum and maximum limits from Rest[intvl].
So here is how the function looks if I want it to do the same as in the last failed attempt (trying to plot x^2 + x when the given function is x^2):
i[fn_, intvl_] := Module[{
ii, p1, p2,
externalSymbol,
localVar, min, max
},
externalSymbol = ReleaseHold[
Hold[intvl] /. {x_, y__} :> HoldPattern[x]
];
ii = ReleaseHold[
Hold[fn] /. externalSymbol :> localVar];
{min, max} = Rest[intvl];
p1 = Plot[ii + localVar, {localVar, min, max}];
p2 = Plot[ii^2, {localVar, min, max},
AxesLabel -> {HoldForm @@ externalSymbol, "y"}];
GraphicsRow[{p1, p2}]];
z = 1;
i[z^2, {z, 0, 2}]

So the symbol z that I used here has been handled properly as a local variable even though it had a global value.
Integratewhich is a symbolic integration, but end up withTableinside your example. This is a bit confusing: are you trying to do numerical integration now with table? – Vitaliy Kaurov Jul 30 '12 at 16:44