Now as an undergraduate student, I am studyign baby Rudin. I know the proof of this theorem are already well explained on match stack exchange here, but I have some question about the proof.
In page 94 of baby Rudin, "there are two ways in which a function can have a simple (the first kind of) discontinuity: either $f(x+) \neq f(x-)$ [in which case the value $f(x)$ is immaterial], or $f(x+) = f(x-) \neq f(x)$ ."
Rudin proves Monotonic functions have discontinuities only of the first kind (have no discontinuities of the second kind) and then the theorem written in the title of this post in the same way the link above did.
However, the proof seems to me to have only considered the first way of the first kind of discontinuity, which is $f(x+) \neq f(x-)$.
Suppose that $f$ is monotonic on $(a,b)$ and discontinuous on infinitely many points in $(a,b)$, and that for every point $x$ at which $f$ is discontinuous, there exists $r(x)$ such that $r(x)=f(x+) = f(x-) \neq f(x)$ (only the second way of the first kind of discontinuity) where $r(x)$ is an irrational number, and $f(x)$ is irrational if $f(x)$ exists. Let $E$ be the set of points at which $f$ is discontinuous. Then, with every point of x we can associate only an irrational number $r(x)$ such that $r(x)=f(x+) = f(x-)$. Because $E$ is the subset of the set of all irrational numbers, we do not know if $E$ is at most countable or not.
I am sure there should be something wrong with my thought, but I cannot figure it out. Please enlighten me!
Thank you in advance.