# Definition of square function

If we have two sets, the set of natural numbers and the set of integers and we relate each member of $\Bbb N$ to its squared value in $\Bbb Z$ then $f(x) = x^2$ and $\Bbb N$ is the domain of function and $\Bbb Z$ is the codomain. Is it okay to define the square function in this manner?

• What you have written is a valid function from $\mathbb{N}$ to $\mathbb{Z}$. If you want to call it a square function, that would also be fine, thought it would beg the question "why "a" and not "the"", ie this is an example, not a general definition. – Tobias Kildetoft Apr 1 '13 at 15:34
• Yes. This defines a function with no ambiguity. – Julien Apr 1 '13 at 15:34
• @TobiasKildetoft I'm sorry Tobias, I'm not a native speaker, I may make mistakes in grammar. – Samama Fahim Apr 1 '13 at 15:55

Yes, your definition is fine: $$f:\mathbb N \to \mathbb Z$$ $$f(x) = x^2\quad\text{i.e.,}\quad x\in \mathbb N \overset{\large f}{\longmapsto} x^2 \in \mathbb Z$$ is defined everywhere on $\mathbb N$, and is a well-defined function, pure and simple.
Note that the image of $f$ is $$\{x^2\mid x\in \mathbb N\} \subset \mathbb N \subset \mathbb Z$$ That is, the image of $f$ is a proper subset of the codomain you've defined for $f$, since $x^2 \geq 0$ for all $x \in \mathbb N$ (and for all $x \in \mathbb Z$, if the domain were $\mathbb Z$). That's not a problem with your definition. That's just an observation.