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.

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).$
