This problem is taken from Zorich, V. (2002). Mathematical Analysis 1. Chapter 4, problem 3.
Let $f:(a, b) \to \mathbb{R}$ be strictly monotone on $(a, b)$. Then prove that inverse $f^{-1}$ is continuous on its domain.
I tried to solve it the following way. Without loss of generality we may assume $f$ is increasing. Let $$m = \lim_{x\to a} \;f(x),\;\; M = \lim_{x\to b} \;f(x)$$ Then the domain of $f^{-1}$ is $D=f((a, b)) \subset (m, M)$. It is known that set of discontinuities of $f$ is at most countable. If it is finite, then $(a, b)$ is a union of finite number of disjoint open intervals and points of discontinuities of $f$. $f$ is continuous on these intervals, then $f^{-1}$ is continuous on their images. Now let $x$ be a point of discontinuity for $f$. There are two options. First, $f(x)$ is isolated point of $D$. Then $f^{-1}$ is continuous at $f(x)$ by definition. Otherwise there is an interval $(c, x] \subset (a, b)$ or $[x, c) \subset (a, b)$ and $f$ is continous on them. Then inverse will also be continuous at $f(x)$.
I do not know how to deal with the case when $f$ has countable set of discontinuities. Please, provide me with some hints.