# Prove a function of functions to be an injection and a surjection

I need to solve this exercise:

Consider $\psi: f\in \mathbb Z^{\mathbb Z} \mapsto f(2) \in \mathbb Z$. Is $\psi$ injective? Is it surjective?

I've never had to work with functions as elements before, so I am a bit confused. Does $f(2)$ mean a function $f$ having $2$ as parameter? Proving $\psi$ to be an injection means that I have to find a $g$ function so that $\psi(f)=\psi(g) \Leftrightarrow f=g$. How do I do that? And how do I prove that $\exists g \in \mathbb Z^{\mathbb Z} : \; \psi(g)=f(2)$? A nudge in the right direction would be really appreciated.

-
$f(2)$ is simply the value of $f$ at $2$. Example: if $f(n)=n^2-1$ then $f(2)=2^2-1=3$. – Andrea Mori Dec 19 '12 at 10:17

• Let $f$ and $g$ be two functions on $\Bbb Z$. Suppose that $f(2)=g(2)$. Is it then true that $f=g$ as functions?

• Let $n\in\Bbb Z$. Is there a function $f:\Bbb Z\rightarrow\Bbb Z$ such that $f(2)=n$?

-
On one hand $\psi$ is not an injection because $f(2x)=g(x^2) \text{ if } x = 2$, but that does not imply $f = g$. On the other hand $\exists f : \mathbb Z \rightarrow \mathbb Z \mid f(2)=n,\; n\in \mathbb Z$ and that is $f\left(\frac{1}{2}n\right)$, so $\psi$ is surjective. Am I correct? – haunted85 Dec 19 '12 at 10:31
No, actually what you're saying doesn't make much sense. I believe that you have a confusion about the notation. To give a function $f$ with domain $\Bbb Z$ you have to specify the value that $f$ attains at each $n\in\Bbb Z$. The notation $f(n)$ simply denotes this value. See the example that I gave in the comment. – Andrea Mori Dec 19 '12 at 10:36
Ok, I will try to rephrase. Let's consider $f(n)=n^2$ and $g(n)=2n$ then $f(2)=g(2)$ but $f \neq g$. So $\psi$ is not injective. Am I ok at least with this? Find hard to answer your second question. – haunted85 Dec 19 '12 at 11:03
Ok, much better now! :) The second question is actually very trivial once you consider what a function really is. The difficulty is only psychological. – Andrea Mori Dec 19 '12 at 11:06
The point is that functions can be defined arbitrarily, in the sense that--in absence of other stringent conditions--you have no constraints in declaring that the value of a function at a given point is any value you want. See William's answer for a "simple" solution. – Andrea Mori Dec 19 '12 at 12:01

$\Psi$ is not injective.

Let

$f(x) = \begin{cases} 0 & \quad x = 2 \\ 1 & \quad x \neq 2 \end{cases}$

and let $g$ be the constant $0$ function. Then $f \neq g$ but $\Psi(f) = f(2) = 0 = g(2) = \Psi(g)$.

$\Psi$ is surjective. Let $k \in \mathbb{Z}$. Let $g_k$ be the constant function taking value $k$. Then $\Psi(g_k) = k$.

-