Beginner proof of image of functions and functions of sets This is the third time I got my proofs handed back from my teacher. She won't tell me what's wrong except I have to redo it. I am running out of luck and I need help towards the right direction!
The proof is as follows:

Let f(n) = { n+2 if n even, 2n if n odd
The function goes from Z(set of integers)->Z
E = set of even integers
O = set of odd integers
Prove: 
a) Im(f)= E
b) f(E) = E
c) f(O) = {n is in Z: n = 4t+2 for t in Z}

This is my work (she handed this back to me due to incorrectness):
a) Proof: Im(f) = E
Let m be in Im(f). 
Then m = n+2 where n is some even number 2k. 
Thus m = (2k)+2 where an even number plus an even number will be an even number.
Also, m = 2n, where n is odd.
When n is odd (2k+1) for some k in Z, m = 2(2k+1) which equals m = 4k+4.
We have an even number, 4k, plus an even number 4 which will always result in an even number.
Thus, in either case when m = n+2 where n is even and m = 2n where n is odd, m is going to be even.
Because in both cases, m is even, m is in E, and Im(f) is a subset of E. 
Let m be in E.
Therefore, m is even because it is an element of the set even numbers (according to the definition).
Thus, there exists an even integer when m = n+2 where n = 2k for some k in Z (an even number plus an even number equals an even number and when m = 2n where n is an odd number.
This means f(n) is in Im(f). Therefore, E is a subset of Im(f).
b) Proof: f(E) = E
Let m be in f(E).
Then there exists an even integer n such that m = n+2.
Since n is even; let's say n = 2k for k in Z, then m = 2k+2.
We can take out the 2 and m = 2(k+1) where k+1 is some integer q in Z. 
Thus m = 2q and m is also even.
So m is in E, for all m in f(E). 
Therefore, f(E) is a subset of E. 
Let m be in E.
So m is even and therefore there exists an integer n such that m=n+2 or m = 2n. 
However, because n must be even for it to be an even integer, we must use the m = n+2 definition of the function; and thus m = n+2 in f(E). 
So m is in f(e) for all m in E.
Therefore, E is a subset of f(E). 
In conclusion we have proved f(E)=E by proving they are both subsets of each other. 
c) Proof: f(O) = {n is in Z: n = 4t+2 for t in Z}
Let m be in f(O). 
Then there exists an odd integer n such that n = 2t+1.
Since n is odd, it has the form of n = 2t+1, where t is in Z. 
When n = 2t+1(for some t in Z), we can apply the function f to get 2n, where n can be 2t+1, and thus 2(2t+1) is formed.
When 2(2t+1) is multiplied out we get 4t+2 and thus 4t+2 is an element of {n is in Z: n = 4t+2 for t in Z} for all m in f(O). 
Thus f(O) is a subset of {n is in Z: n = 4t+2 for t in Z}
Let m be in {n is in Z: n = 4t+2 for t in Z}.
Therefore, there exists an integer t such that m = 4t+2 which equals 2(2t+1) which equals 2n where n = 2t+1 and n is odd. 
So m is in f(O) for all m in {n is in Z: n = 4t+2 for t in Z}.
Therefore, {n is in Z: n = 4t+2 for t in Z} is a subset of f(O). 
In conclusion, we have proved f(O) = {n is in Z: n = 4t+2 for t in Z}
 A: Image :

In mathematics, an image is the subset of a function's codomain which is the output of the function on a subset of its domain.

In your example, we have :
$f : \mathbb Z \rightarrow \mathbb Z$
thus, the domain of $f$ is $\mathbb Z$ and, for a), we have to prove that $Im(f) = E$, where $E \subset \mathbb Z$ is the set of even numbers.
To prove this, we have to show that, for each $n \in \mathbb Z$, $f(n) \in E$, i.e. that $f(n)$ is even (this proves $Im(f) \subset E$) and that for each $k$, there exist $n$ such that $f(n) = 2k$ (this proves that $E \subset Im(f)$).
For $Im(f) \subset E$ we have two cases : $O(n)$ or $E(n)$ :
(i) if $O(n)$, then $f(n) = 2n$; but the double of a number is always even: thus, $E(n)$.
(ii) if $E(n)$, then $f(n) = n+2$; but if $n$ is even, also $n+2$ is: thus, $E(n)$.
In both cases $E(n)$; thus, we conclude that $Im(f) \subset E$.
For $E \subset Im(f)$, we have to show that for every even $n$ there is an $m \in \mathbb Z$ such that $f(m)=n$, i.e.that there are no even numbers which are not images of some number under $f$. 
In this case, we cannot apply the same argument as above, i.e.to consider $2k$, for $k$ whatever, with the two cases : $O(k)$ or $E(k)$.

Consider the case with $k=8$, i.e. $2k=16$; in this case we have to apply the $n+2$ case of the definition of $f$; i.e.$f(8)=8+2=10$ and we cannot conclude that $16 \in Im(f)$.

But for all even $n > 2$, we have that also $n-2$ is even; thus $f(n-2)=n$, and $n \in Im(f)$.
The remaining case is $n=2$, and it is also "covered" by $f(1)=2$.
Thus, in conclusion, for all even $n$, there is $m \in \mathbb Z$ such that $f(m)=n$, i.e.$E \subset Im(f)$.
b) is trivial: we already know that $f$ maps all numbers into $E$ [$f(n)$ is even, for all $n$], i.e.$f(\mathbb Z) \subset E$. Thus, we have only to show that $E \subset f(E)$, i.e. that for every even $n$ there is an even $k$ such that $n=f(k)$.
But for every even n, we have both $n=2k$, with $k$ odd, and $n=(n-2)+2$ [for $n=2$, we have both $2=2 \times 1$ and $2=2+0$]. The second case gives us the result, i.e. assume $k=n-2$ and we have found $k$ even (because if $n$ is even, also $n-2$ is) such that $n=f(k)$.
In conclusion, we have shown that :

for every even $n$, there is a even $k$ such that $n=f(k)$

and this amount to :

for all $n$, if $n \in E$, then $n \in f(E)$.

By definition of $\subset$, this is :


$E \subset f(E)$.


