If Function is a set of ordered pairs then why do we call it as a rule? I am confused here with the vocabulary we use while defining functions. If function f is a set of ordered pairs, then what is meant by a function f is a Rule which which produce new elelments out of some given elements.Why do we have two definitions of function.
 A: When the concept of function $f$ from a set $A$ into a set $B$ is introduced for the first time, it is usually described as a rule that converts each element of $A$ into an element of $B$. This is just an idea of what a function is. It cannot be a definition unless we then define the meaning of the word “rule”.
So, we have the formal definition of a function $f$ from a set $A$ into a set $B$ as a subset of $A\times B$ such that, for each $a\in A$, there is one and only $b$ in $B$ such that $(a,b)\in f$. And then we introduce the notation $f(a)$ (with $a\in A$), which means that only element $b\in B$ such that $(a,b)\in f$. This definition may be hard to understand at first, but it is a real definition (that is, it is not just an attempt to explain the meaning of the word).
A: The former is a rigorous definition for a function in axiomatic set theory, whereas the latter is the intuitive understanding of functions. You use terms like "rule" and "produce new elements" but these do not have a wholly rigorous definition. In math, we take for granted only basic assumptions (axioms) and logical inference rules. From these, we formally define every object we are interested in. Specifically, almost all modern math uses the axioms of set theory, under which every mathematical object is a set. In fact, even ordered pairs can be defined as specific sets. From here, we can define functions $f: A \longrightarrow B$ as a special subset $f \subseteq A \times B$ where $\forall a \exists b (a, b) \in f$ and $(a, b)\in f \text{ and } (a, b') \in f \implies b = b'$. We write $f(a)=b$ for $(a, b) \in f$.
We can continue further to make set theoretic definitions for most of the objects of modern math. By doing so, we can put math on a rigorous and uniform foundation.
