In "The Way of Analysis, Revised Edition - Jones and Bartlett" we have the following exercise:
p125: Excercise 1: Let $f$ be a function defined on a closed domain. Show that $f$ is continuous if and only if the inverse image of every closed set is a closed set.
I am stuck at the example of function of which I claim is not continuous, but is defined on a closed domain and the inverse image of every closed set is a closed set. See the picture below. Could anybody help me out confirming / debunking if my counter-example is indeed a counter-example?

Your counter example has a problem.
Find the inverse image of $[1, 3/2]$
The answer is not closed.
We have three components,$$ [1,a]\cup(c,d]\cup[e,2]$$ and the middle one is not closed.