Is there any function $f:\mathbb{R} \to \mathbb{R}\cup \{\pm \infty\}$ such that $f$ is lower semi continuous only at $\mathbb{Q}$ ?
A function $f:\mathbb{R} \to \mathbb{R}\cup \{\pm \infty\}$ is said to be lower semi continuous on $A$ if the set $\{x\in A : f(x) \le \alpha\}$ is closed for any $\alpha \in \mathbb{R} $ .
Other equivalent definition, $f$ is lower semi continuous at $x_o$ if $$\lim_{\delta \to 0}m_{\delta} (x_o) =f(x_o) $$
\begin{align} m_{\delta} (x_o) &=inf \{f(x) : x\in (x_o - \delta,x_o+ \delta)\}\\ \end{align}
If all you want to know is "Is there ..." as opposed to "Construct one for me ..." then there is this study by Z. Grande:
http://matwbn.icm.edu.pl/ksiazki/fm/fm126/fm12611.pdf
He shows that any set of reals can be the set of points of upper semi-continuity for a function $f:\mathbb R\to\mathbb R$.
In fact he shows that if $A$ and $B$ are real sets, $B\subset A$, $B$ is a set of type ${\cal G}_\delta$, and $B$ is dense in the interior of $A$ then there is a function $f:\mathbb R\to\mathbb R$ whose set of points of continuity is precisely $B$ and whose set of points of upper semicontinuity is precisely $A$.
So there is nothing very special about the rationals that makes the problem interesting or worth losing sleep over.