I translated "There is someone who loves no one besides himself or herself" as $$\exists x\left(L\left(x,x\right)\wedge \forall z\left(L\left(x,z\right)\rightarrow \left(z=x\right)\right)\right)$$ but the textbook gave $$\exists x \forall y \Bigl(L(x,y) \leftrightarrow (x=y)\Bigr)$$
Where $L(x, y)$ means "$x$ loves $y.$"
As I understand the first one says: "There exists a person such that, he loves himself and for all people, if this person loves someone then this someone is himself"
The second one says: "There is a person for all people such that this person loves someone if and only if they are both the same(it's himself)"
Now I wonder are these two formulas equivalent?
Yes, they are equivalent. In your first formula, we can move the $\forall z$ outside the parenthesis. And in the context of $\exists x\forall z$, we have that $L(x,x)$ is equivalent to $L(x,y)\leftarrow (x=z)$. Substituting this into your formula, you get $${L(x,z)\leftarrow(x=z)} \land {L(x,z)\rightarrow(x=z)}$$ which is equivalent to $L(x,z)\leftrightarrow(x=z)$.