You are confusing your act of finding out the value of the function at a particular element of the domain with the function. That would be like thinking that a person does not have a telephone number until you look them up in the telephone directory and dial. Whether or not you look them up in the telephone directory does not determine whether or not they have a phone number.
In mathematics, a function $f\colon X\to Y$ is a subset of $X\times Y$ such that
- For all $x\in X$ there exists $y\in Y$ such that $(x,y)\in f$; and
- If $x\in X$, $y,y'\in Y$ and $(x,y),(x,y')\in f$, then $y=y'$.
When this happens, we write $f(x)=y$ to signify that $(x,y)\in f$; this is unambiguous by $2$.
Now consider what happens if we "dualize" the two parts of the definition:
- For all $y\in Y$ there exists $x\in X$ such that $(x,y)\in f$;
- If $y\in Y$, $x,x'\in X$ and $(x,y),(x',y)\in f$, then $x=x'$.
A function that satisfies the first property is said to be "onto" or "surjective." (Note that you have the definition wrong; you are using the first property that defines a function to be a function instead of this extra condition). A function that satisfies the second property is said to be "one-to-one" or "injective.
Your function, viewed as a function $f\colon \mathbb{N}\to\mathbb{N}$ is the set
$$\{(0,0), (1,0)\}\cup\{ (n+1,n)\mid n=1,2,3,4,\ldots\}.$$
As such, you are absolutely correct that the function is onto (though not for the reason you state: it's onto because for every $n\in\mathbb{N}$, the codomain, there exists $x\in\mathbb{N}$, the domain, with $f(x)=n$: if $n=0$, we can take $x=0$; if $n\gt 0$, we can take $x=n+1$), and is not one-to-one (because $f(0)=f(1)$, even though $0\neq 1$).
Now, $f$ is just a set. It is. It is not a procedure, it is not a process, it is not the act of you evaluating the function. It's a set. Its functional properties depend only on its properties as a set, and not on what we do with it. We don't "call" a functionn
(What "causes [you] mental dissonance" would likewise cause you mental dissonance when you consider the one-to-one and onto function $f\colon \mathbb{R}\to\mathbb{R}$ given by $f(x)=x$...)
Take $A=\{1,2,3\}$ and $B=\{a,b\}$. Then there are 2 possibilities for $f(1)$. Then, if $f(2)=f(1)$, there is 1 possibility for $f(3)$ and if $f(2)\neq f(1)$, there are 2 possibilities for $f(3)$. So, you have $2\cdot (1+ 2)=6$ possibilities.
Best Answer
You can never attempt to answer if a function is one-to-one or onto without first knowing the domain and codomain.
For example the function $$f: \mathbb{R}\to \mathbb{R},\quad f(x) = x^2$$ is neither one-to-one ($1$ and $-1$ both map to $1$) or onto (nothing maps to e.g. $-1$).
The function $$g:\mathbb{[0,\infty)}\to [0,\infty),\quad g(x) = x^2$$ is both one-to-one and onto.
We have only changed the domain and codomain, and this changed the properties of one-to-one and onto.