To show two sets are equal we show each is contained in the other, hence we must show $f^{-1}(E^c) \subseteq (f^{-1}(E))^c$ and $(f^{-1}(E))^c \subseteq f^{-1}(E^c)$. To do this we take an element in one of them and show it is also in the other. I'm going to do the first inclusion.
Let $x \in f^{-1}(E^c)$. By the definition of inverse image we know that $f(x) \in E^c$, but this means that $f(x) \notin E$. Hence $x \notin f^{-1}(E)$ and we conclude that $x \in (f^{-1}(E))^c$. Therefore $f^{-1}(E^c) \subseteq (f^{-1}(E))^c$.
Try the second inclusion. :)
Best wishes,
Fantini.