You need to fully qualify the name ostream with the name of the namespace that class lives in:
std::ostream
// ^^^^^
So your operator declaration should become:
friend std::ostream& operator << (std::ostream &os, const Number &f);
// ^^^^^ ^^^^^
Alternatively, you could have a using declaration before the unqualified name ostream appears:
using std::ostream;
This would allow you to write the ostream name without full qualification, as in your current version of the program.