Given Sets X,Y, a function or mapping from X to Y is a rule that assigns each x∈X a unique element f(x)∈Y
Formally:
f:X⟶Y
Where X is the domain of the function and Y is the codomain or image of f

Optional Properties
Injective - One-to-One:
∀x1,x2∈X,f(x1)=f(x2)⟹x1=x2
Surjective - Onto:
∀y∈Y,∃x∈X:f(x)=y
Bijective - Both injective and surjective
Example
A function f:Z⟶Z is defined as f(x)=x2 where x∈Z