Why do some say that $f(x)=\frac{1}{x}$ discontinuous? A continuous function $f:X\to Y$ is one which satisfies the following property: for every open set $U\subset Y$, the set $f^{-1}(U)$ is open in $X$. 
I don't see why according to this definition $f(x)=\frac{1}{x}$ is discontinuous at $0$. The inverse image of every open set of the form $(a,\infty)$ is open, it is $(0,\frac{1}{a})$. Similarly, the inverse image of $(-\infty,-a)$ is $(-\frac{1}{a},0)$.
And one can see that the inverses of other forms of open sets are also clearly open. 
Why then is $1/x$ discontinuous according to some?
 A: Part of the challenge is that calculus, arguably more than many other areas of contemporary mathematics, is heavily influenced by classical terminology and methods.
The concept of "function", which is taken somewhat for granted today, developed over a long period of time, and for much of that time the notion was much more broad than the present one. See Wikipedia's article "History of the function concept".  Quoting from that article about Hardy's famous book A Course in Pure Mathematics: 

Hardy 1908, pp. 26–28 defined a function as a relation between two variables $x$ and $y$ such that "to some values of $x$ at any rate correspond values of $y$." He neither required the function to be defined for all values of x nor to associate each value of $x$ to a single value of $y$. This broad definition of a function encompasses more relations than are ordinarily considered functions in contemporary mathematics. For example, Hardy's definition includes multivalued functions and what in computability theory are called partial functions.

This kind of definition was not unique to Hardy; he was no doubt presenting mathematics as many at the turn of the 20th century understood it, and nobody can doubt Hardy's mathematical acumen. 
From a viewpoint like the one he expressed, it makes perfect sense to have $1/x$ be both undefined and discontinuous at $x = 0$.  And that is the way the language is often used in calculus today. 
In the 19th and 20th centiries, the notion of functions changed from a viewpoint that thought of functions primarily as expressions, to a viewpoint that also incorporated functions defined by series, and onward to the modern viewpoint where a function need not have any defining "rule".  By its nature, calculus is more attuned to functions that are defined by formulas or series, and as such the terminology has maintained some of the traditional character from a time when the concepts of formula and function were conflated.  
On a related note, some mathematicians today define a function to be continuous at a limit point of the domain if the function can be extended to the limit point in a way that makes it continuous in the sense quoted above. So these mathematicians would say that $(1-x)/(1-x)$ defines a continuous function, because the function can be defined at $x = 1$ in a way to make it continuous.  These mathematicians would also say $1/x$ is discountinuous at $x = 0$, because it cannot be extended to $x = 0$ in a continuous manner. 
The main conclusion to take here is to remember that the terminology of calculus is not as standardized as the terminology of more advanced mathematics (and even that is not as standardized as you might suspect).  And the terminology of calculus is more influenced by traditional viewpoints on functions. So, although calculus can be formalized in the style of real analysis, the definitions actually used in a calculus course may not match the ones that would be used in a course on analysis.  
P.S. Another interesting example of "traditional terminology" in calculus relates to "indeterminate forms". 
A: For what's worth, I checked two french books and Rudin's PMA, and in all cases, discontinuity is only defined for a point of the domain of definition of the function. As the other answers suggest, there may be other definitions of "discontinuity", for points where $f$ is not defined. I would say it's relatively harmless, apart from introducing misleading terminology.

It's misleading for another reason than just terminology, I think. A function is defined to be given by a set of "inputs", a set of "outputs", and a relation such that each input has an output. It makes little sense to tell anything about (continuity of) a function where it's not defined, in some sense it doesn't even "belong" to the function.
For example, $f:x\rightarrow 1/x$ is defined on $]-\infty,0[\;\cup\;]0,+\infty[$. I could tell it's discontinuous at $0$. But then I could also tell it's discontinuous at $(1,2)$ (where this is a point in $\Bbb R^2$), or discontinuous at $\emptyset$, or anything completely meaningless: any mathematical object that is not part of the set of inputs may be said to be a point of discontinuity, but you learn nothing.
Notice that you can also define a function $g:]1,2[\rightarrow \Bbb R$ such that $g(x)=1/x$. Then $f$ and $g$ are not the same function, even though they are given by the same formula. And even $h:]1,2[\rightarrow \Bbb ]1/2,1[$ such that $h(x)=1/x$ is not the same thing as $g$. For example, $h$ is a bijection, whereas $g$ is not. Thus, the three components (input set, output set, relation) are all very important in the definition of a function.
Here, $0$ has a particular status only because when we see $]-\infty,0[\;\cup\;]0,+\infty[$, we see also the whole real line, and this additional number $0$. But the function is just not defined at $0$. This conveys more useful information to say that, than to say it's discontinuous.

Whatever we may decide about discontinuity where the function is not defined, there is a good news: there won't be another definition of continuity, for one good reason. The topological definition of continuity states that, given two topological spaces $A,B$, $f:A\rightarrow B$ is continuous iff $f^{-1}(S)$ is open for all open subsets $S \subset B$.
This is the standard definition of continuity, and is equivalent in the real case with the definition which implies that $x\rightarrow 1/x$ is continuous. For example, for $a>0$, 
$$f^{-1}(]-\infty,-a[ \;\cup\; ]a,+\infty[)=]-1/a,0[\;\cup\;]0,1/a[$$
which is an open set.

Hence, I would say that these books I checked do the right thing: where the function is defined, we can argue about continuity or discontinuity. Where it's not defined, it's meaningless.
A: No, I do not know that your function is discontinuous at zero. And indeed you don't understand why. Although your case is rather specific, I don't believe that a function is discontinuous outside its own domain of definition. Would you say that $x \mapsto \log x$ is discontinuous at $x=-1$? I definitely would not.
Your case is somehow special, since $0$ does not belong to the domain of definition, but it's an accumulation point. We might agree that a function is discontinuous at such points if it can't be defined at those points so that the resulting extension is continuous. This idea is often understood by calculus teachers, since it is considered kind of natural.
But if you move on to general topology, you'll discover that the concept itself of discontinuity is rather useless, since continuity is interesting when it occurs.
Coming back to your problem, it clear that no definition of $f(0)$ will turn $f$ into a continuous function (since $\lim_{x \to 0\pm} \frac{1}{x}=\pm\infty$). But I would not claim that $f$ is discontinuous tout court.
A: Here is how I explain it in my calculus class. There are three slightly different ways to talk about continuity.


*

*A function $f$ is continuous at $c$ if $f(c)=\lim_{x\to c}f(x)$, with some one-side limits allowed at the endpoint of a domain. I.e. a function is discontinuous at a point if the function is not defined there or the value does not equal the limit. Thus, $f(x)=\frac 1x$ is discontinuous at zero.

*A function is continuous in an interval if it is continuous at every point in that interval. Thus, $f(x)=\frac 1x$ is continuous in any interval that does not contain zero and is not continuous in any interval containing zero.

*A function is continuous if it is continuous at every point in its domain. Thus, $f(x)=\frac 1x$ is a continuous function.
Unfortunately, not everyone is consistent in terminology. But I seem to agree with the sources you reference.
