In[1]:= g[x_] := Integrate[f[s] s^x, {s, 0, 1}]
g[x_] := h[f[s] s^x, {s, 0, 1}]
g[x_] := h[f[s] s^x]
g[a]
g[s]
Out[4]= h[s^a f[s]] (* This is what we want *)
Out[5]= h[s^s f[s]] (* This is not what we expect *)
Then How to handle this kind of situation? Module it ! mmtc then automatically rename the inside dummy variables with same names as outside.
q[i_] := Module[{j}, a[i, j] b[j]]
In[7]:= q[i1] q[i2]
Out[7]= a[i1, j$513] a[i2, j$514] b[j$513] b[j$514]