I am trying to show that the following function is discontinuous using only the fact that a function $f:\mathbb{R} \to \mathbb{R}$ is said to be continuous if for each open subset $V$ of $\mathbb{R}$, $f^{-1}(V)$ is an open subset of $\mathbb{R}$.
$g(x)=\left\{\begin{array}{ll}\frac1x&\text{if $x\ne0$}\\0&\text{if $x=0$}\end{array}\right.$
Exactly how can this specific definition be applied to to prove discontinuity? I have dealt with discontinuity using limits, but this definition is leaving me confused.
The set $(-1,1)$ is open, but$$g^{-1}\bigl((-1,1)\bigr)=(-\infty,-1)\cup\{0\}\cup(1,\infty),$$which is not an open set.