Enumerate the rationals in $[0,1]$ (ie. $\mathbb{Q}\cap[0,1]$) by $q_n$. Define $f:[0,1]\to\mathbb{R}$ by $$ f(x)= \begin{cases} 1/n & \text{if } x=q_n \text{ for some }n\\ 0 & \text{otherwise} \end{cases} $$
Also, define for $c\in[0,1]$ and $r>0$ $$\text{Osc}(f,c,r)=\sup\{ |f(x)-f(y)|:x,y\in[0,1]\cap(c-r,c+r)\}$$
Since $\text{Osc}(f,c,r)$ is non-increasing as $r\to0^+$, we can define oscillation at $c$ as $\text{Osc}(f,c):= \lim_{r\to0^+}\text{Osc}(f,c,r)$.
The question is then what is the value of $\text{Osc}(f,x)$ when $x=q_n$ or when $x$ is irrational?
When $x=q_n$ the oscillation is $\frac 1 n$ and when $x$ is irrational it is $0$. It is a well known result that the oscillation of $f$ at $x$ is $0$ iff $f$ is continuous at $x$. (You can try to prove this). In this case you can verify that $f$ is continuous at each irrational number.