# image of a piecewise function

I am given the piecewise function $f: \mathbb{Z} \to \mathbb{Z},$ $f(x) =\left\{ \begin{matrix} 2n, & \text{if }n \text{ is even} \\ n, & \text{if }n \text{ is odd} \end{matrix}\right.$

I need to find the image of this function. So far I have tried plotting out a list of points, but I am unable to find a pattern. Is there a better approach to this problem?

• You have a piecewise function, so begin by focusing only on one piece at a time. For instance, what's the image of $f$ under the set of odd integers? – John Griffin Nov 9 '17 at 4:06
• So $\text{im}(f)$ contains all odd integers, as well as all integer multiples of 4. But how do I express that as one set? Do I just say $\{n \mid n$ is odd, or $n=4t, t \in \mathbb{Z} \}$? – wz-billings Nov 9 '17 at 4:11
• Exactly @jeanquilt. – TRUSKI Nov 9 '17 at 4:45

$f(2) = 4 ,f(4) = 8, f(6) = 12$
How astounding ... $$f(2n) = 2(2n) = 4n$$
Thus the image contains all the odd integers and all the multiples of $4$.