What is a surjective function? I am a 9th grader self-studying about set theory and functions. I understood most basic concepts, but I didn't understand what is a surjective function. I have understood what is an injective function, and if I know what is a surjective function, I think I could understand what is a bijective function (this is my main goal).
In formal terms a function $f$ from $A$ to $B$ is said to be surjective if for all $y$ in $B$, there exists $x$ in $A$ such that $f(x)=y$. I don't understand this clearly because i'm still new to these notations. Can you explain this in intuitive way? And for example can you give me a surjective function that is not injective, and inversely, and neither one of the two?

Let $f:A\to B$ (i.e. $f$ has domain $A$ and codomain $B$). Then:


*

*$f$ is injective iff every value of $B$ is obtainable at most once.

*$f$ is surjective iff every value of $B$ is obtainable at least once.

*$f$ is bijective iff every value of $B$ is obtainable exactly once.

