Let $f:G\to H$ be a group homomorphism. Let $N \triangleleft H$ be a normal subgroup. Show that $f^{-1}(N)$ is a normal subroup of $G$
By definition of normal subroup, for any element of $H$, which is mapped from $g$ $$f(g)Nf(g)^{-1}=N$$
Apply inverse function. Since it is an inverse of a homomorphism, it is a homomorphism.
$$f^{-1}(f(g)Nf(g)^{-1}) = f^{-1}(N)$$ $$= f^{-1}(f(g))f^{-1}(N)f^{-1}(f(g^{-1}))$$ $$= gf^{-1}(N)g^{-1} = f^{-1}(N)$$
QED
Your solution is completely wrong.
Notice that $$f^{-1}(N) := \{g \in G\mid f(g) \in N\}$$. I.e., the set of all element in the domain that get mapped to N. This is the preimage of $N$ under $f$.
This is not the inverse image of the set $N$, since the inverse function only exists when $f$ is bijective.
However, when the inverse function exists, the two things are the same sets and hence the notation is well-defined.
So, in your proof you can't use an inverse function because you don't know that it exists. Rather use the definition of preimage I provided.