Function continuous at odd numbers from $0$ to $99$, but discontinuous everywhere else. I have an idea about this but am not entirely sure if it's right. 
If I have a function, say $g(x) = (x-1)(x-3)(x-5)...(x-99)$
The roots of g(x) are only odd numbers from 0 to 99. 
$$
f(x) = \begin{cases} 
      g(x) & x \in\mathbb{Q} \\
      0 & x \notin\mathbb{Q}
   \end{cases}
$$
Is this correct?
 A: Yes, your approach is fine. We can simplify a bit. Given a finite set of rationals $A$, let $d(x)$ be the distance from $x$ to $A$.
then the function $f(x)= \begin{cases} d(x) & x \in\mathbb Q \\ 0 & x\not\in \mathbb Q \end{cases}$
Is continuous only at $A$.
A: Your approach is correct. For any odd number $x$ between $0$ and $99$,
$$ \lim_{y \to x} |f(y)| \leq \lim_{y \to x} |g(y)| = 0 = f(x)
$$
Otherwise $f$ locally behaves like the indicator function of $\mathbb{Q}$, which is discontinuous.
A: I think your answer is correct. The limit of $f(x)$ as $x$ approaches an odd integer is $0$ (because $g$ is continuous) and its value there is $0$ too, so $f$ is continuous there. For rational values of $x$ other than the odd integers $g(x) \ne 0$ but there are irrationals arbitrarily nearby at which $f$ is $0$. For irrational values of $x$ , $f(x) = 0$ but there are noninteger nearby rationals $q$ where $f(q) = g(q)$ is bounded away from $0$.
If I'm wrong (and you're wrong) someone will comment here and tell me. Then I can delete my answer, or leave it as an instructive false start.
