In his book "Geometry, Topology, and Physics", M. Nakahara illustrates the topological definition of continuity with the following example:
I am having problems with this example.
Evidently, $$ f:~~ (\,-\,1/4,~0\,]\,\longrightarrow\,[\,1,~1+1/4)~~, $$ wherefrom $$ f^{-1}:~~[\,1,~1+1/4)\,\longrightarrow\, (\,-\,1/4,~0\,]~~. $$
At the same time, it is pointless to seek $f^{-1}(~(1-1/4\,,~1+1/4)~)$. Indeed, $(1-1/4\,,~1+1/4)$ is not part of $\,$Im$\,f$, and therefore $f^{-1}$ is not defined on $(1-1/4\,,~1+1/4)$. Please correct me if I am wrong.

It turns out that the pullback is defined for points outside the image (whereas the inverse--when it exists--is not).
To see this, if $y\notin Im(f)$, then: $$f^{-1}(y) := \big\{x\in dom(f)\text{ }\big|\text{ }f(x) = y\big\} = \emptyset.$$ Couple this with the fact that for every subset $S$, we have: $$f^{-1}(S) = \bigcup\limits_{y\in S}f^{-1}(y)$$ and we get $f^{-1}(S) = f^{-1}(S\cap Im(f))\cup f^{-1}(S\cap Im(f)^c) = f^{-1}(S\cap Im(f))\cup \emptyset = f^{-1}(S\cap Im(f))$.
Thus in the problem, $f$ pullsback an open set $S:= (1-1/4,1+1/4)$ to a non-open set $[1,1+1/4)$ and so is not continuous.
Alternatively, using the restricted topology on the $Im(f)$, we can ignore the points outside the image. Note that: $$(1-1/4,1+1/4)\cap Im(f) = [1,1+1/4)$$ is relatively open and its preimage is $(-1/4,0]$, which again is not open in $\mathbb{R}$ with the original topology.
To clarify, as per request, a function has an inverse defined over its image if it is 1-1. In this case, the point-wise pullbacks are all singletons (i.e. $f^{-1}(y)= \{x\}\equiv x$). The inverse image is just the image of the inverse.