PROBLEM: I do understand that for one input of $x$, $f(x)$ can only one output. But I can't understand how can $2$ inputs of $x$ give $1$ output of $y$.
I know for $f(x) = x^2$ , we can have same $f(x)$ for $x$ and $-x$ and for $f(x) = 3 $ is a singleton but take this specific example:
http://www.purplemath.com/modules/fcns.htm
This example says it is a function. What I see from here is this:
$f(-3) = 3$,
$f(-2) = -6$,
$f(-1) = 0$,
$f(0) = 15$,
$f(1) = 0$.
For $f(-1)$ and $f(1)$ to be same I need to have $f(x) = x^2 - 1$ but then $f(-3)$ will not fit into this relation. For $f(0) = 15$ I can take $f(x) = x + 15$ but then none of the other relations fit. So, I can't figure out if there is any relation that exists for "$f(x) = $ something here" and hence it does not seem to be a function. But I know I am wrong but how?
Not all the functions should be mathematical expressions such as $f(x) = ax^2+bx+c$ or $f(x) = \sin(x)$ or etc. We consider functions simply as a mapping from one set to another as in your example; mapping of the elements may or may not result in a mathematical expression.
Note that in your example, even if it gives a mathematical expression, $f(x) = x^2 - 1$ is not the only function where $f(-1) = f(1) = 0$. For example take $f(x) = \cos(x^2-1)-1$. What I mean here is that if we try to consider all the functions as a mathematical expression, we may have hard time doing that because there are many possibilities with given mapping. Moreover, it would be wrong to express a function as in your example with a mathematical expression.
As an example, two sets $A$ and $B$ and a function $f: A \to B$ with $A = \{-2,-1,0,1,2\}$, $B = \{-1,0,3\}$ and $$f(-2) = 3$$ $$f(-1) = 0$$ $$f(0) = -1$$ $$f(1) = 0$$ $$f(2) = 3$$ Notice that $f$ satisfies the conditions of a function $f(x) = x^2-1$ so it seems that we can say $f(x) = x^2-1$. However, stating this without any restrictions is wrong because $f(x) = x^2-1$ is a function $\mathbb{R} \to [-1,+\infty)$ but we only have $5$ elements in domain ($|A| = 5$) and $3$ elements in codomain (also in range, $|B| = 3$). It also takes some irrational values although we don't have any in set $A$. So we can't say $f(x) = x^2-1$ even if the mapping fits $f(x)=x^2-1$.