From Euler's Analysis book he gave the definition "A function of a variable quantity is an analytic expression composed in any way whatsoever of the variable quantity and numbers or constant quantities". When i was in highschool the teacher taught me that a function is a rule that we apply to number and get other number. Now when I read a modern analysis book, it tell that a function is a subset of $A \times B$ where A is domain and B is codomain sastifying if (a,b)=(a,d) then c=d . All of that refer to me as mathematician are trying to describe a mathematical object rigorously.
For example the equation $x^2 -4x +3=0$ has two roots $x=1, x=3$, it has nice property that when you know these roots, the term $x^2-4x+3$ could be represent as $(x-3)(x-1)$ but without be put in the equation $x^2 -4x +3=0$ the term $x^2-4x+3$ alone seem meaningless. Another example is consider the statement for two number $6^n -1$ and $6^n +1$ for all interger $n$ we put in at least one number we get is prime, it is not true and we can disprove that if we let $n$ be the form $2k$ where k is interger then $6^(2k) -1$ would be factored out as multiple of two intergers not 1 and itself. But how can we exactly tell what the "form" is? For the form $2k$ for each $k =1,2,3,...$ we get $2k =2,4,6,...$ and for each x is real number we get a number $f(x)=x^2-4x+3$ by the rule f, then we can write $f(x)=(x-3)(x-1)$. As mathematic developed it is generalized to other branches like we could consider $f(A)=A^2 -4A+3I$ where A and I are square matrix,also we get f(A)=(A-3I)*(A-I).
So the notion function is just mathemacian trying to describe an object after that all "factorization of roots of polynomial" or "all polynomials of degree n has n complex roots" things will make sense. Is it a mathematical object in the same sense of circle,line,quadrilateral,.. all of that plane figures which are favour of mathematicians back in time?.If so, in modern day people tend to study function and all that figures could be describe as a function. In higher mathematics, Do we study complicated mathematical objects and all that things are defined as a function?