Confusion over Directly Proving Surjectivity I have a question related to the surjectivity of a function. I understand what surjectivity is, in the sense that, if $f:X\longrightarrow Y$, then $f$ is surjective if $\forall_{y\in Y}\exists_{x\in X}f(x)=y$, or simpler (using the image) $f(X)=Y$. My troubles seem to lie in actually proving that either of these hold.
For most proofs that I've seen on surjectivity, if the function has an inverse, then they use that and plug it back into the formula for the function to establish that the function is indeed a surjection. This usually goes as follows:
Ex) For $f:\mathbb R\longrightarrow\mathbb R$, $f(x)=\frac{1}{2}x$, you find $x=2y$ for some $x\in\mathbb R$, and say $f(2y)=y$ completes the proof.
I know that, algebraically, plugging in $2y$ into $f$ gives $y$, but I don't understand how showing $f(2y)=y$ completes the proof. Is it related to the fact that all real numbers can be described as 2 times another real number?
Second, the above hinges on the fact that $f$ has an inverse. What if $f$ doesn't have an inverse?
Ex) $f:\mathbb R \longrightarrow \mathbb R$, $f(x)=x^3-x$ does not have an inverse, but if you graph it, it clearly is onto.
In both cases, the second definition provided above, $f(X)=Y$, is extremely easy to understand, but it feels useless - almost as if you know that the image of the domain is equal to the codomain, then you wouldn't need to prove it's onto in the first place.
Any suggestions or help in understanding this would be much appreciated. If it helps, I'll mention that I don't seem to have any problem proving whether a function is injective, or not.
 A: I figured out what I was lacking. The methodology above (showing that $f(2y)=y$, shows that $f$ is surjective) makes sense with this answer.
Clearly, if a function is surjective, then by that question $X=f(f^{-1}(X))$. Which means, for $f:X\longrightarrow Y$, if you plug in $Y$ for $X$ into the equation above, then the function would map $f^{-1}(Y)=X$, and $f(X)=Y$ which confirms the idea as to why $f(2y)=y$ shows that $f$ is onto.
It doesn't help if the function doesn't have an inverse, though, like above. But it answers to the obscurity as to why finding an inverse, can work.
A: You would normally restrict to part of the domain where the function is one-to-one (i.e., injective.) The tangent function is a good example of a function which is onto (i.e., surjective) with infinitely many solutions $x$ of $f(x)=y$. So, you can restrict $\tan$ to $(-\pi/2,\pi/2)$ and obtain an inverse. Of course there is no limit to how pathological such a restriction may be, but smooth functions are much better in general.
