Proving the surjectivity of a function Proving the injectivity of a function starts with lines similar to the following:

Assume that $f(x_{1}) = f(x_{2})$. If $x_{1} = x_{2}$, then $f$ is an injection.

Checking for the surjectivity of a function requires solving for the inverse and so on. Is there a similar way to prove the surjectivity of a function using a process similar to the one above?
 A: Define $f : X \to Y$. Assume $y \in Y$. If you can show there exists at least one $x \in X$ such that $f(x) = y$, then you can show that $f$ is surjective.
Alternatively, say you define a function $g : Y \to X$. If you can show that $(f \circ g)(y) = y$ for all $y \in Y$, then $g$ is a right inverse to $f$, and thus surjective.
Alternatively, let $f^{-1}(B)$ denote the preimage of $B$, i.e. it is not an inverse, but rather
$$f^{-1}(B) = \{ x \in X \mid f(x) \in B \}$$
Then if for all $B \subseteq Y$ we have $f(f^{-1}(B)) =B$, then $f$ is surjective. Similarly, for all $B,C$ such that $B\subsetneq C \subseteq Y$, $f$ is surjective if $f^{-1}(B) \subsetneq f^{-1}(C)$.
All four of these are equivalent to surjectivity for a function $f$. Though, in my opinion, the first two are the main ones of utility.
A: A function $f: X \to Y$ is surjective if and only if

for each $y \in Y$ there is a $x \in X$, such that $f(x) = y$.

Let's consider an example. Let $f: \mathbb R \to \mathbb R$ be defined as
$$f(x) = 2x + 1 \; .$$
We want to show that $f$ is surjective. So let $y \in \mathbb R$ be arbitrary. We need to find a $x \in \mathbb R$, such that $f(x) = y$. So the equation
$$2x + 1 = y$$
must hold for this to be true.
Solving this equation for $x$ gives
$$
x = \frac{y-1}{2} \; .
$$
Now we are done: For $y \in \mathbb R$ we choose
$$
x = \frac{y-1}{2} \; ,
$$
then
$$
f(x) = f\left(\frac{y-1}{2}\right) = 2 \cdot \frac{y-1}{2} + 1 = y - 1 + 1 = y \; .
$$
A: Another way for proving surjectivity or onto is by $\forall b \in B \space \exists a \in A [f(a) = b]$
So an example would be $f(x) = 2x+1$ where $f: \mathbb R \rightarrow \mathbb R$.
$$\text{Let $b$ be an arbitrary number in the codomain.} \\ \text{Let $a = \frac{b-1}{2}$} \\ f(a) = 2a +1 \\ f(a) = 2 (\frac{b-1}{2}) +1 \\ f(a) = b-1+1 \\ f(a) = b \\ \text{Since $b$ is arbitrary we can say this function is surjective.}$$
