What is the difference between a function and a formula? I think that the difference is that the domain and codomain are part of a function definition, whereas a formula is just a relationship between variables, with no particular input set specified.
Hence, for two functions $f$ and $g$, $f(x)$ can be equal to $g(x)$ for all integers, say, but if the domain of $f$ is {2, 3, 4} and the domain of $g$ is {6, 7, 8, 9}, the two functions will be different. 
And on the converse, if the functions 'do different things' - i.e. $f(x) = x$ and $g(x) = x^3$ - but the domains of $f$ and $g$ (these are the same) are set up such that the values of the functions are the same over the domain (this would work in this case for {-1, 0, 1}), then the functions are the same, even though the formulas are different.
Is this correct?
Thank you.

I was taking a refresher course on Calculus and as a pre-requisite, was reviewing algebra and some pre-algebra as well :). It was said, for a function to be a function, it must have a definite output corresponding to every input. Based on that, $f(x) = x$ is a function, but $f(x) = \sqrt{x}$ is not, as there are always two answers that could be the square root of a positive number (one positive and the other negative). However, both can be called formula. I believe this is at least one key differentiator of the two. 
