Your $f$ is not bijective and so it does not have an inverse in terms of inverse functions. In terms of relations and inverse relations, we have $f(C)$ with $C$ a set is defined as $f(C):=\{f(x)~:~x\in C\}$, that is to say it is the set of images of elements of $C$.
Here, $f(\{1,2,3\}) = \{1^2+1,2^2+1,3^2+1\}=\{2,5,10\}$
$f^{-1}(C)$ with $C$ a set is defined as $f^{-1}(C)=\{x~:~\exists c\in C~f(x)=c\}$, that is to say, it is the set of preimages of elements of $C$.
Here $f^{-1}(C) = \{-1,0,1\}$ since $(-1)^2+1=2$ is an element of $C$, as is $0^2+1=1$ and $1^2+1=2$.
Note that $f^{-1}(f(C)) = f^{-1}(\{2,5,10\})=\{-3,-2,-1,1,2,3\}$ and that $f(f^{-1}(C))=f(\{-1,0,1\})=\{1,2\}$. Neither of which are equal to $C$.
Now... in the event that $f$ actually was bijective, we would have had $f(f^{-1}(C))=C$ but that is not the case here hence why we find them to be unequal.