Question regarding surjective mapping I have come across a question while solving practice papers on the topic 'Functions'.
The question is as follows -

If $f : X \to Y $, find $f (X)$, when $f $ is a surjective or onto mapping.
Here $X $ and $Y $ are non-empty sets

Here is my approach -

As $f $ is a surjective mapping of $X$ to $Y$, then for each $y \in Y $, there exists an $x \in X $, such that $f (x) = y $. Thus $f (X) = Y$.

Can I be provided with a more formal proof ?
Suggestions for correction in my answer and a detailed answer with explanation would be helpful.
 A: Just to be really really pedantic, let us prove it by double inclusion. Let us set $f(X):=\left\{y\in Y\mid \exists\,x\in X \text{ such that } y=f(x)\right\}$. Thus $f(X)\subseteq Y$. On the other hand, surjectivity means that for every $y\in Y$ there exists $x\in X$ such that $y=f(x)$, that is to say, that $Y\subseteq f(X)$. Conclusion: $Y=f(X).$
A: Below an indirect proof. 
Remark : ( after incorrect edits have been made, then fixed) : since set equality means reciprocal inclusion, the indirect proof consists in showing that the negation of this reciprocal inclusion is false. Set equality is not defined in terms of reciprocal membership. 
That " $Y$ is not included in  $f(X)$ " is contradictory follows immediately from surjectivity. 
To show that " $f(X)$ is not included in $Y$ " is contradictory, I use the definition of a function  $f : X \to Y$ as relation between $X$ and $Y$ and therefore as subset of the cartesian product " $X × Y$". Saying that "$f(X)$ is not included in $Y$" would mean that $f$ contains an ordered pair that does not belong to the cartesian product " $X \times Y$" , which contradicts the definition of $f$. 

