A function in mathematics is a relation between a set of inputs (domain) and a set of possible outputs (range), where each input is related to exactly one output. It is typically written as y=f(x)y = f(x)y=f(x), where xxx is an input and yyy is the corresponding output.