Quote by phyzguy
The output of NDSolve (mysol) is a list. You need to take the first element of it in your myy function definition, as follows:
In[25]:= mysol = NDSolve[{y'[x] == x, y[0] == 1}, y, {x, 0, 1}]
In[26]:= myy[x_] := Evaluate[y[x] /. mysol][[1]];
In[27]:= myf[x_] := Piecewise[{{myy[x], 0 < x <= 1}, {x^2, x > 1}}];
In[28]:= NIntegrate[myf[x], {x, 0, 2}]
Out[28]= 3.5

Ok. Thanks a bunch. It's working now. :)