The function is defined on $\Bbb{R}^+\times\Bbb{R}^+$ as $f(x,y)=(2x+y, xy)$
I know the usual way to prove $f$ is injective is to assume $f(a,b)=f(c,d)$, and then show that this implies $(a,b)=(c,d)$.
That leads to two equations: $2a+b=2c+d$ and $ab=cd$.
I struggled to manipulate these, so I wondered if the function is not injective, and can I find a counterexample? I was lucky to realize that $f(3,4)=f(2,6)=(10,12)$. So the function is not injective, but I still haven't proved it in general, i.e. without relying on a specific counterexample.
The proof for surjective would look like: Assume $(a,b)\in\Bbb{R}^+\times\Bbb{R}^+$. Can we find, in terms of $a$ and $b$, $(x,y)\in\Bbb{R}^+\times\Bbb{R}^+$ such that $f(x,y)=(a,b)$?
Again there are two equations: $2x+y=a$, and $xy=b$
Solving the first equation for $y$ and substituting into the second equation leads to the quadratic equation $2x^2-ax+b=0$.
Using the quadratic formula, we get a discriminant of $a^2-8b$, which can easily be made negative by choosing $b>\frac{a^2}{8}$.
Does that mean any ordered pair $(a,b)$ satisfying $b>\frac{a^2}{8}$ is not in the image of the function?
A single counterexample is all you need. You don't need to prove it in general. If a single counterexample exists then the statement isn't true.
And if the statement isn't true..... then it's not true.
.......
However if you don't want to randomly grasp for counterexamples you can attempt to prove it is injective, find the snag, and point out it will fail for a class of counter examples.
i.e.
$2a+b=2c+d$ and $ab=cd$
If we let be $b = 2c-2a +d$ and then $a(2c-2a+d)= 2ac -2a^2 +ad = cd$ so
$d(c-a)= 2ac -2a^2 = 2a(c-a)$.
If $c=a$ then we do get that $b=d$ and $(a,b) = (c,d)$ but if $c\ne a$ then we get $d=2a$ and $b=2c$.
And we will always have $f(a,b)=f(\frac 12b,2a)= (2a +b, ab)=(2(\frac 12 b)+2a, \frac 12b\cdot 2a)$.
so any such $(a,b) \ne (\frac 12b, 2a)$ will be a counterexample.
But a single counterexample is good enough and probably easier.
(The way I'd do it: is to let $xy = 0$ so if $x = 0$ we get $f(0,y) = (y,0)$ and if $y = 0$ we get $f(x,0) = (2x, 0)$ so if $y=2x$ and $x=1$ and $y=2$ we get $f(1,0) = (2,0)$ and $f(0,2) = (2,0)$..... FWIW)
surjectivity:
Yeah, I think so.
Let see. If $f(x,y) = (4, 3)$
Then $2x+y=4$ and $xy = 3$. $y= 4-2x$ so $x(4-2x) = 3$ so $8x^2-4x+3 =0$ so $x =\frac {4\pm \sqrt{16-4*3*8}}{16}$ has no (real) solution.
It's not surjective.
Good job!