For any real number x and any positive integer $n$, we can uniquely write $x = mn + r$, where $m$ is an integer (positive, negative or zero) and $0 ≤ r < n.$ With this notation we define $x \bmod n = r.$ The number of discontinuity points of the function $f(x) = (x \bmod 2)^2 + (x \bmod 4)$ in the interval $0 < x < 9$ is?
How should I approach this problem?
$f(x)$ is continuous at $a$ iff $\lim_{x\to a-} f(x) = \lim_{x\to a+} f(x)$.
If for some natural $n$ and $\delta$, $n > \delta > 0$ then $nk+\delta \mod n = \delta \mod n = 0$ but $nk- \delta \mod n=-\delta \mod n = n-\delta$. So $\lim_{x\to nk^+}x\mod n = \lim_{x\to nk^+} x- nk = \lim_{\delta \to 0} \delta = 0$ but $\lim_{x\to nk^-} x\mod n = \lim_{x\to nk^-}x - (nk - n) = \lim+{\delta \to 0} n-\delta = n$.
But for any $a$ so that $nk < a < nk + n$ and $\delta < \min(a-nk, nk+n -a)$ we have $a\pm \delta \mod n = \delta$ so $\lim_{x\to a^+} x\mod n = \lim_{x\to a^-} x\mod n = a-n$.
So $x \mod n$ is continuous at $a$ if and only if $a$ is not a multiple of $n$.
$f(x) = (x\mod 2)^2 + (x\mod 4)$ will be continuous at all $x$ that are not an even integer.
If $x$ is an even integer we must consider if $x$ is a multiple of $4$ or not.
If $2 > \delta > 0$ then
$f(4k + \delta) = (4k + \delta\mod 2)^2 + (4k + \delta \mod 2) = \delta^2 + \delta \to 0$.
While $f(4k-\delta) = (4k - \delta \mod 2)^2 + (4k -\delta \mod 2) = (2-\delta)^2 + (4-\delta) \to 4+4 = 8$.
$0 \ne 8$ so $f$ is not continuous at $4k$.
$f(4k +2+ \delta) = (4k + 2+\delta\mod 2)^2 + (4k + 2+\delta \mod 2) = \delta^2 + (2 + \delta) \to 2$.
While $f(4k +2-\delta) = (4k +2 - \delta \mod 2)^2 + (4k +2 -\delta \mod 2) = (2-\delta)^2 + (2-\delta) \to 4+2 = 6$.
$2 \ne 6$ so $f$ is not continuous at $4k$.
So $f$ is not continuous at even integers.
Note: $g(x) = (x\mod 2)^2 - (x\mod 4)$ will have a different answer.
What will it be?