Existence of a function whose limits go to infinity almost everywhere In the past few months I've come across some problems that seem to suggest the existence of a (not necessarily continuous) function $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $\lim_{x\to k} \, f(x)= \infty \,\,\,\forall \, k \in \mathbb{R}\backslash\mathbb{Q}$. Does such a function exist? If so, can we construct an example?
 A: We can construct $f$ such that whenever $(q_n)_n$ is a sequence of rationals converging to an irrational $x,$ then $(f(q_n))_n$  tends to $\infty.$ But we cannot have a function $f$ such as you ask.
For $n\in \mathbb N$ let $$S_n=\{x\in \mathbb R \backslash \mathbb Q: |f(x)|<n\}.$$ Take $n_0$ such  that $S_{n_0}$ is uncountable. (If every $S_n$ were countable then  the set of irrationals would be a countable union of countable sets, and hence would be countable.) 
There exists $x\in S_{n_0}$ such that $x$ is a limit point of $S_{n_0}$ \ $\{x\}.$  But that implies there exists a sequence $(x_j)_j$ of members of $S_{n_0}$ \ $\{x\}$ converging to $x,$ and for each $j$ we have $|f(x_j)|<n_0.$    So it is not the case that $\lim_{y\to x} f(y)=\infty.$
Note. To show that an uncountable   $S \subset \mathbb R$ has an accumulation point: Take $n\in \mathbb Z$ such that $S\cap [n,\infty)$ is uncountable.  Let $$y=\sup \{q\in \mathbb Q \cap [n,\infty): [n,q)\cap S\; \text { is countable }\}.$$ We  have $y<\infty.$ And  the set $$([n,y)\cap S)\cup \;\{y\}\;=(\cup \{[n,q)\cap S:q\in \mathbb Q \cap [n,y)\})\;\cup \;\{y\}$$ is only countable . But by def'n of $y,$ if $\epsilon \in \mathbb Q^+$ then $[n,y+\epsilon)\cap S$ is uncountable. So $(y,y+\epsilon)\cap S$ is uncountable and hence not empty, for every $\epsilon \in \mathbb Q^+.$ So $y$ is an accumulation point of $S.$ 
