You're defining a function, f, inside the definition of another function, main.
Not allowed. (Actually you can if you're using lambdas but that's different.)
Put them above (and outside of) main, or below (and outside of it). In the latter case, you'll need some prototypes at the top to keep your compiler happy. In a simple example like this, I'd just define them at the top of the file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
double f(double(x))
{
return (x*x*x*x);
}
double g(double(x))
{
return (4 * x*x*x);
}
double h(double(x))
{
return (12 * x*x);
}
int main /* etc. */