Prove that $f$ is not locally bounded on any point of $(0,1)$ Definition :   
Assume that $I$ is an interval.
A function $f : \mathbb R \to \mathbb R$ is locally bounded on $c \in I$  if there exist $\delta \gt 0 $ and $M \gt 0$ such that :
$\forall x \in I \space\space \space |x-c| \lt \delta \implies |f(x)|\le M$   
Question :  
Assume that $f:\mathbb R \to \mathbb R$ is a function defined this way :
If $x$ is not rational, $f(x)=0$.
If $x=\frac{p}{q}$ ( rational ) such that $p,q \in \mathbb Z$ and $q \gt 0$ , then $f(x)=(-1)^pq$.
Prove that $f$ is not locally bounded on any point of $(0,1)$ .  
Note :  What should i do ? Is this gonna work if assume that $f$ is locally bounded on an arbitrary point of $(0,1)$ ? Will it reach a contradiction?
 A: You should assume that $c, \delta, M$ are given, then find the $x$ such that $|f(x)| > M$. In particular, it should be easy to construct an $x$ such that $|f(x)| = p$ where $p$ is a prime larger than $\max(M, 1/\delta)$.
A: Two examples of not locally bounded functions defined on $\mathbb R$:


*

*First one is explicit: A NOWHERE LOCALLY BOUNDED FUNCTION. This example is almost the one you mention in your original post.

*Second one using a Hamel basis (and therefore Axiom of Choice) which on top is linear: A DISCONTINUOUS MIDPOINT CONVEX FUNCTION
A: Pick $x \in (0,1)$, and suppose such $M>0$ exists. There are finitely many $p/q$ such that $q\leq M$ and $p/q \in (0,1)$. Choose an open interval $I$ around $x$ which does not contain any of those. Since the rationals are dense, $I \cap I_\delta$, where $I_{\delta}=(x-\delta,x+\delta)$, must have a rational $a/b$ in it for any $\delta$. By construction of $I$, such rational must have $b> M$. Then $|f(a/b)|>M$. Therefore, no $\delta>0$ will do.
As a sidenote, this argument is very similar to the one which proves that the Thomae's Function is continuous at the irrationals. 
