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?

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$.
