The Prenex Laws express a number of logical equivalences involving quantifiers:
Prenex Laws
Where $\varphi$ is any formula and where $x$ is not a free variable in $\psi$:
$ \forall x \ \varphi \land \psi \Leftrightarrow \forall x (\varphi \land \psi)$
$ \psi \land \forall x \ \varphi \Leftrightarrow \forall x (\psi \land \varphi)$
$ \exists x \ \varphi \land \psi \Leftrightarrow \exists x (\varphi \land \psi)$
$ \psi \land \exists x \ \varphi \Leftrightarrow \exists x (\psi \land \varphi)$
$ \forall x \ \varphi \lor \psi \Leftrightarrow \forall x (\varphi \lor \psi)$
$ \psi \lor \forall x \ \varphi \Leftrightarrow \forall x (\psi \lor \varphi)$
$ \exists x \ \varphi \lor \psi \Leftrightarrow \exists x (\varphi \lor \psi)$
$ \psi \lor \exists x \ \varphi \Leftrightarrow \exists x (\psi \lor \varphi)$
$ \forall x \ \varphi \to \psi \Leftrightarrow \exists x (\varphi \to \psi)$
$ \psi \to \forall x \ \varphi \Leftrightarrow \forall x (\psi \to \varphi)$
$ \exists x \ \varphi \to \psi \Leftrightarrow \forall x (\varphi \to \psi)$
$ \psi \to \exists x \ \varphi \Leftrightarrow \exists x (\psi \to \varphi)$
Notice that it is the very last equivalence that shows the equivalence between $\forall x((x \neq 0) → \exists y (xy = 1))$ and $\forall x \exists y ((x \neq 0) → (xy = 1))$. So yes, your answer and the book's answer are logically equivalent.
Couple more comments though:
Notice the 'strange' behavior of the second and fourth to last one, where the quantifier changes its type.
Also notice that together with the Quantifier Negation Laws, these Prenex laws can be used to move any quantifier to the outside, and thus to the beginning (or 'top') of any FOL statement. When all quantifiers end up at the start of the statement, we say the statement is in Prenex Normal Form (PNF). The PNF has important theoretical and practical applications. Resolution, for example, is a technique that is commonly used for automated theorem provers, but requires that all statements first be rewritten in PNF.
It is perhaps for this last reason that some books and teachers would like to see all quantifiers at the start of a sentence. However, for symbolization sake, I am not a fan of such insistence. For example, take the sentence:
"Every cube with nothing to its left will have something to its right"
A straightforward symbolization of this sentence would be:
$\forall x ((Cube(x) \land \neg \exists y \ LeftOf(y,x)) \to \exists z \ RightOf(z,x))$
Now, you can use the Prenex Laws (and Quantifier Negation) to move the quantifiers to the outside:
$\forall x ((Cube(x) \land \neg \exists y \ LeftOf(y,x)) \to \exists z \ RightOf(z,x)) \overset{\text{Quantifier Negation}}{\Leftrightarrow}$
$\forall x ((Cube(x) \land \forall y \ \neg LeftOf(y,x)) \to \exists z \ RightOf(z,x)) \overset{\text{Prenex Law}}{\Leftrightarrow}$
$\forall x (\forall y (Cube(x) \land \ \neg LeftOf(y,x)) \to \exists z \ RightOf(z,x)) \overset{\text{Prenex Law}}{\Leftrightarrow}$
$\forall x \exists y ((Cube(x) \land \ \neg LeftOf(y,x)) \to \exists z \ RightOf(z,x)) \overset{\text{Prenex Law}}{\Leftrightarrow}$
$\forall x \exists y \exists z ((Cube(x) \land \ \neg LeftOf(y,x)) \to \ RightOf(z,x))$
Now, I don't know about you, but I frankly find that final statement awfully hard to read and interpret. I know what it is supposed to mean, but if I was given that statement out of the blue, I would have to work at it to understand what it means ... in fact, I would probably push these very same Prenex Laws to push the quantifiers back in in order for the statement to make more sense. But it is the existence of the two 'weird' Prenex Laws that really prevents me from quickly seeing what those quantifiers end up as, and thus what exactly the statement means. Long story short: I highly recommend you introduce the quantifiers on an 'as needed' basis, and not any earlier, which is why I do prefer the textbook's answer over your answer.
yexists for0..... this added understanding is not in the original" $\quad$ Apologies, I mean that the two translations are, without qualification, semantically truly indistinguishable. Whenever the element0has been assigned tox—in which casex≠0 → xy=1immediately holds—the OP's translation just says that some element (assigned the placeholdery) exists; this is a pure tautology, not any genuine claim, and not any auxiliary presumption/understanding added by the OP. – ryang Jun 11 '24 at 14:47