Can I create my own function like Trigonometric or Exponential When I want to solve mathematical problems, most of the time I meet the following functions


*

*Algebraic like polynomials.

*Trigonometric like sin(), cos(), tan(), cot().

*Logarithmic like log().

*Exponential like exp().

*Hyperbolic like sinh(), cosh(), tanh(), coth() that can be written with the help of (4).

*Combination of 1-5.
My questions are:


*

*Where do these functions come from? Are the origins of them from nature or real-world or are abstract concepts?

*Can I create my own function? I know I can create a new function by combining these functions. But can I invent a pure function from scratch that can not be written with the help of 1-5?

*What is the definition of mathematical function? Can we say functions of Mathlab, Java, C and other programming languages are mathematical?

*Is my question true!?
 A: *

*These functions naturally arise in everyday problems. For example polynomials are just a consequence of adding and multiplying. The exponential function has the peculiar property that it is its own derivative, and in some way this property ("eigenfunction under the derivative ioperator") is the typical cause for it appearing. The logarithm is just the inverse of exponential and the trigonometric functions are readily constructed from the exponential (because $e^z=\cos z+i\sin z$ in complex numbers); in other words they also have nice properties under taking the derivative. And you have already mentioned that the hyperbolic functions are combinations of the above (though they also have similar properties to the trigonometric functions). Ultimately, it is the eigenfunction property of the exponential which makes this whole bunch of functions come up "everywhere", even in real world problems.

*Yes, you can. There exist many useful functions that cannot be expressed "elementary", i.e. as combinations of the functions mentioend above. Such as the Lambert $W$ function. For a notorius non-continuous example think of the function that is $1$ for rational $x$ and $0$ otherwise, which often serves for counterexamples. As one is alllowed to define functions very arbitrarily, you can easily come up with something not yet (specifically) covered by anyone else. However, the usefulness might be questioned.

*A function $f\colon A\to B$ is uniquely given by specifying the value $f(a)\in B$ for all $a\in A$. Thus it is fully detemined by the set $\{\,(a,f(a))\mid a\in A\,\}$, which can be any subset $F$ of the cartesian product $A\times B$ with the property that for all $x\in A$ there exists $y\in B$ with $(x,y)\in F$ and  whenever $(x,y)\in F$ and $(x,z)\in F$, then $y=z$. A piece of code written in C, for example that is a function of type double f(double) for example, is almost something like a function $\mathbb R\to\mathbb R$. But not exactly: First, it works only with a smaller set that $\mathbb R$, namely the finite set $R$ of doubles; but that's okay, we should be content with a function $R\to R$. However, even then this need not be a function: The code may fail for certain inputs (e.g. divide by zero). Or the code may return different outputs for the same input on subsequent calls (e.g. by having side-effects or depending on time or rand).

*Questions cannot be true or false.

A: Paul Dirac invented the delta function to deal with some of the problems he had in quantum mechanics. Formally it isn't even a function, but it did spur an investigation into what a now called generalised functions. His 'function' is so useful, it's been used in many other areas of mathematics, from signal processing to solving PDE's. 
To answer your questions more specifically:
1) They come from both, really. The delta function is an abstract thing, though it was to solve "real world problems" if quantum mechanics counts as such. The exponential function is often introduced in terms of compound interest, while on the other hand I've never seen anyone mention cyclotomic polynomials with a hint of 'real world'!
2) Yes, of course! There are many examples of "special functions" which would have arisen from need, and someone had to define them.
3) Pick up a book on introductory set theory for stuff about functions. Everyone should have at least one book on basic set theory.
4) This question is, well, semantically void. Questions can't be true or false!
A: Of course you can invent your own function.  If it is useful for something, you might even get other people to use it.  
Functions in languages such as C are not quite the same as mathematical functions, because the computer's "real" numbers are not mathematical real numbers: they are limited in precision and range, and the computations are only done in limited precision.
