I'm proving that a $C^r$ function $f:\mathbb{R^2}\rightarrow \mathbb{R}$ is not injective. I've found a function $g:\mathbb{R^2}\rightarrow \mathbb{R^2}$ defined as $g(x,y)=\bigg(f(x,y),y\bigg)$, and proven that it's $C^r$. To prove my main problem, I'm assuming $f$ is injective, and that allows me to apply the inverse function theorem to $g$, in such a way that gives me an open map from an open set in the domain of $g$ to the open image of $g$, such that $g$ has a differentiable inverse $g^{-1}:g(A)\rightarrow A$.
Now I want to prove a contradiction in the injectivity of $f$, by showing that $g^{-1}$ is not defined at certain points, specifically a line. Consider $f(x,y)=b$ then $g(x,y)=(b,y)$, Now I should be able to find that the line that $g^{-1}$ isn't defined on $\forall (b,z)$, $z\neq y$, since that would imply that $f(x,z)=b$.
I don't quite see how $g^{-1}$ being defined on $(b,z)$ implies that $f(x,z)=b$?
Edit Here is the original problem. It is problem $2$-$37$. I've seen other solutions suggest to make $g$ satisfy the conditions of $f$ from $2$-$36$, which is why I left it in.

Thanks!
As mechanodroid said, I think this approach doesn't work quite well. There is another approach that comes from topology, but I just translate it into the world of calculus:
If any continuous map $f: \mathbb{R}^2\rightarrow \mathbb{R}$ is injective, then you can also take three points $a,b,c\in \mathbb{R}^2$ in a straight line such that $f(a)<f(b)<f(c)$ and such that the open interval $(f(a),f(c))$ lies in the image of $f$. To do this, take two distinct points $a,c$ and apply the intermediate value theorem to the function $g:[0,1]\rightarrow \mathbb{R}$ that is induced by $f$ with the line between $a$ and $c$ as its domain, any point $y$ between $f(a)$ and $f(c)$ must be hit by some $b$. Then consider a function $h$ that is induced by $f$ on a semicircle from $a$ to $c$, this is a continuous map $[0,\pi]\rightarrow\mathbb{R}$ that satisfies $h(0) = f(a), h(\pi) = f(c)$ but it cannot hit $f(b)$ because $f$ is injective ($b$ does not lie on the semicircle from $a$ to $c$ and $h$ hitting it would contradict injectivity of $f$). This in turn contradicts the intermediate value theorem.
The original topology version is that continuous images of connected sets must be connected and that taking away a point from $\mathbb{R}^2$ does not destroy connectedness, while removing a point from $\mathbb{R}$ leaves you with two connected components.