Question on the reasoning behind determining surjectivity of a function I understand the idea of surjectivity and its definition:
"A function f is surjective if f:A->B if $\forall y\in Y,\exists x \in X$ such that $y=f(x)$"
However I have a question on the following excerpt from a textbook:
"Given  the function f:R->R where $f(x)=x+1$ determine whether the function is a surjection.(R for the set of all real numbers)
Solution: for sujectivity we rewrite the definition as a universal implication:
$y\in R \implies \exists x \in R $ such that $y=f(x)$ 
'
I understand up to this point. But my issue is with the following:
' then we put the definition of the function into this implication: $y\in R\Leftarrow\Rightarrow y=f(x)\Leftarrow\Rightarrow y=x+1\Leftarrow\Rightarrow x=y-1$ which tells us that given y in the codomain R then $y=f(x)$ if $x=y-1$. Hence f is surjective'
My question refers to the first part of the implication " $y\in R \Leftarrow\Rightarrow y=f(x)\Leftarrow\Rightarrow y=x+1$"
How/ does y being in the codomain imply that y=f(x) ? (does it?)
 A: We are given $f:\mathbb R\to\mathbb R$ given by $f(x)=x+1$, and we wish to see if it's surjective. As the book says, the meaning of "$f$ is surjective" here could be written $y\in\mathbb R\implies\exists x\in\mathbb R\text{ s.t. }y=f(x)$ (with an implied $\forall y$).
Then the next part of the book is written in a concise way that I agree is a bit confusing. Here is a rewrite with more words that might clarify what they intended. It's way more words than would be required for a proof, but I wanted to make sure I clarify what's going on.

Let's hope this function is surjective, and so let's use the definition to write in what we hope to prove. Substituting in the definition for $f(x)$ (in other words, using the fact that $y=f(x)\iff y=x+1$), we see that we want "$y\in\mathbb R\implies\exists x\in\mathbb R\text{ s.t. }y=x+1$". Note that $y=x+1\iff x=y-1$, so it's enough to prove "$y\in\mathbb R\implies\exists x\in\mathbb R\text{ s.t. }x=y-1$". But now this is kind of obvious, If $y$ is a real number, then $y-1$ is certainly a real number that equals $y-1$.
Since this is true, the equivalences mean that the original goal "$f$ is surjective" is true as well. $\square$

The important facts of the discussion above might be summarized $$y\in\mathbb R \iff \exists x\in\mathbb R\text{ s.t. }y=f(x)\iff\exists x\in\mathbb R\text{ s.t. }y=x+1\iff\exists x\in\mathbb R\text{ s.t. }x=y-1$$ where the first forward implication you were worried about is only known at the end, since the argument actually went something like $$y\in\mathbb R \implies \exists x\in\mathbb R\text{ s.t. }x=y-1\iff\exists x\in\mathbb R\text{ s.t. }y=x+1\iff \exists x\in\mathbb R\text{ s.t. }y=f(x)$$ (and $\exists x\in\mathbb R\text{ s.t. }y=f(x)\implies y\in\mathbb R$ is just a side comment following from the fact that $\mathbb R$ is the codomain).
To add on to the above confusion about the order of implications, the author left implicit all of the $\exists x$ quantifiers in the chain of reasoning.
