Finitely many discontinuities and uniform convergence Suppose that $\left\{f_n\right\}$ converges uniformly to $f$, and that each $f_n$ has at most $M$ discontinuities, where $M\in \mathbb{N}$ is a fixed value. The $f_n$ don't need to be discontinuous at the same points.
QUESTION: Does it necessarily follow that $f$ has at most $M$ discontinuities?
This occurred to me while I was taking a walk, and I was wondering if the above statement was true or if there is a counterexample(possibly pathological).
 A: Yes $f$ has at most $M$ discontinuities.  If $f$ has a discontinuity at $p$, there must be $\epsilon > 0$ such that in any neighbourhood of $p$ there are points $x, y$ with $|f(x) - f(y)| > \epsilon$.  If $f_n \to f$ uniformly, for
sufficiently large $n$ we have $|f_n - f| < \epsilon/3$, and then the condition
of the last sentence holds for $f_n$ with $\epsilon$ replaced by $\epsilon/3$, 
so $f_n$ is also discontinuous at $p$. 
A: The answer Robert Israel gave is spot on.  But because I'm still a novice (undergrad), I had a hard time understanding where he was getting at at first.  So I'm going to elaborate on his answer.  I just joined StackExchange, and this is my first time posting an answer. Constructive criticism is appreciated.
To answer the question, first we need to show that if $f$ is discontinuous at $c$, then after a certain term in the sequence $(f_n)$, all the later terms in the sequence are also discontinuous at $c$.  I prove this below.  But you can skip the proof and go straight to the explanation is you want.

PROOF:
Suppose $f$ is discontinuous at $c$.  Then by negating the definition of continuity, we know that there exists $\epsilon>0$ such that for all $\delta >0$, there exists an $x$ in the domain of $f$ such that $|x-c|<\delta$ and $|f(x)-f(c)|> \epsilon $.
Choose such an $\epsilon$ that meets the requirements of the above definition/negation.
Then $\forall \delta>0, \exists x$ such that $|x-c|<\delta$ and $\epsilon>|f(x)-f(c)|=|f(x)-f_n(x)+f_n(x)-f_n(c)+f_n(c)-f(c)|$ $\leq |f(x)-f_n(x)|+|f_n(x)-f_n(c)|+|f_n(c)-f(c)|$ $\forall$ $n\in\mathbb{N}$.
Because the sequence of functions $(f_n)$ converges uniformly to $f$, then we may choose $\epsilon/3$ such that $|f_n(c)-f(c)|<\epsilon/3$ and $|f(x)-f_n(x)|<\epsilon/3$ for all $n\geq N$ for some fixed number $N\in \mathbb{N}$.
Combining this new information with our earlier work, we see that we see that
$\forall \delta>0, \exists x$ such that $|x-c|<\delta$ and
$\epsilon>|f(x)-f_n(x)|+|f_n(x)-f_n(c)|+|f_n(c)-f(c)|< \epsilon/3 +|f_n(x)-f_n(c)|+\epsilon/3$, $\forall n\geq N$.
Finally,
$\forall \delta>0, \exists x$ such that $|x-c|<\delta$ and
$\epsilon/3 >|f_n(x)-f_n(c)|$, $\forall n\geq N$.

At any given point, $f$ is either continuous or discontinuous.  There is no in-between.
From the original question, we take it as a given that all the terms in $(f_n)$ are continuous everywhere in the domain of $f$, except at a maximum of $M$ points for each function in the sequence (where the points of discontinuity might vary in location).  (For simplicity's sake, I think of the domains of $f$ and every $f_n$ to only be wherever $(f_n)$ converges uniformly.)  Now because $(f_n)$ converges uniformly to $f$, at any points where all terms in $(f_n)$ are continuous, $f$ is continuous on those points also.  But wherever $f$ is discontinuous, after a certain term in $(f_n)$, all the terms share a discontinuity at the same point, by the above proof.  Therefore, the number of discontinuities of $f$ cannot exceed $M$. 
