Subtle.

The functions (not "equations") are not technically equal to each other. The first one does not exist at because is undefined.

If you get onto calculus you'll learn about "limits" and how the "limit" of the first function when x "tends towards" -2 is equal to 1. But the very fact of there being a zero on the bottom at one point means that, as it stands, the functions are indeed not the same.