Function
A function is a machine that takes in one thing and spits out another. [TODO gross definition]
Examples
The following table is a function:
| x | (0,0) | (1,0) | (0,1) | (1,1) |
| f(x) | 0 | 1 | 1 | 0 |
That table describes the input and output of an XOR gate. A XOR gate (another example of a function) can also be seen in the figure.

The following lines of C++ code are a function:
string reverseString(const string &s) {
string returnStr = "";
for (int i = s.size() - 1; i >= 0; --i) {
returnStr.append(s[I]);
}
return returnStr;
}