Functions and maps: the input-output rule
A function or map f: A → B assigns exactly one output in B to each input in its domain A. The codomain B is the stated target set. The image or range is the subset of B actually produced by inputs from A.
A relation fails to be a function when one allowed input is assigned two different outputs, or when an input in the declared domain is assigned no output.
Several different inputs may share one output; that fact alone does not violate the definition of a function. A rule can be written by an equation, a table, an arrow diagram, or words, but its domain and codomain are part of the definition.
When checking a proposed map, name the domain first, inspect every input exactly once, and then verify that every listed output lies in the codomain. Keep this basic well-definedness test separate from later questions about one-to-one or onto maps.
A map k: {1, 2, 3} → {red, blue, green, yellow} is given by k(1) = red, k(2) = red, and k(3) = blue. What is its image?
A rule is proposed as m: integers → integers, m(x) = x/2. Does this define a well-defined function with that stated domain and codomain?