If we have a function $f:A\rightarrow \mathbb{R}$ where $A$ has infinitely many holes and is subset of $\mathbb{R}$( i.e. $\mathbb{Q} \subset \mathbb{R}$). Then can $f$ be a continuous function still?
The textbook we are using defines a function $f:A\rightarrow \mathbb{R}$ is continuous at a point $c\in A$ if for $(\forall\epsilon > 0)(\exists \delta > 0)$ such that $|f(x) - f(c)|<\epsilon$ whenever $|x - c|<\delta$ and $c\in A$. This seems to imply that we can have a continuous function $f:\mathbb{Q}\rightarrow \mathbb{R}$ by this definition.
I ask because when I look at this proof : Prove that the inverse image of an open set is open. I can't shake this feeling about properly working with the holes of the preimage. Since even as we shrink the $\epsilon$ in the proof, the holes in the rationals should always exist in the set.
I am not sure if my understanding of the definitions is correct which may resolve this problem.
Yes. I think your issue is that you're assigning "blame" to the wrong mathematical object, and/or intuiting the effect backwards.
That $\mathbb{Q}$ is totally disconnected1 is a fault of $\mathbb{Q}$, not of functions defined on $\mathbb{Q}$. This fault does not impose restrictions on what can be a continuous function. In fact, it's quite the opposite: each "hole" of $\mathbb{Q}$ can be seen as an opportunity for a function to "jump" while still being continuous. For example, the following is a continuous function $\mathbb{Q} \to \mathbb{R}$:
$$ f(x) = \begin{cases} 0 & x < \sqrt{2} \\ 1 & x > \sqrt{2} \end{cases} $$
1: This is a technical term; it means that every subset that has at least 2 points must be disconnected