Question about how to define open sets for continuous rational functions I am having difficulty doing the following question using the language of open sets.  
Let $(X,\mathcal{T})$ be a topological space, and let $f,g:X\rightarrow \mathbb{R}$ be continuous functions. 
Let $A=\{x\in X:g(x)=0\}.$ Prove that the function $h:(X-A)\rightarrow \mathbb{R}$ defined by $h(x)=\frac{f(x)}{g(x)}$ is continuous
I know how to show that a rational function is continuous if the functions in both numerator and denominator are both continuous in the sense of how is done in a beginning real analysis course.
For this particular question, for the condition $\{x \in A^{c}:\frac{f(x)}{g(x)}<0\},$ if I want to use an open set to describe the inverse image of the range, how do I account for the two cases where $f(x) > 0$ and $f(x) < 0$ given that $g(x) < 0.$
Thank you in advance.
 A: As restrictions of continuous functions are continuous,
f and g over R - A are continuous.
As g is never 0 over R - A, 1/g is defined and continuous over R - A.
Since the product of two continuous functions is continuous,
f/g is continuous over R - A.
A: Let $h \colon \mathbb{R}\setminus \{0\} \to \mathbb{R}$ be such that $h(x)=1/x$ for every $x \in \mathbb{R}$.
Let $h' \colon \mathbb{R^2} \to\mathbb{R}$ be such that $h'(x,y)=xy$.
As we know, $h$ and $h'$ are continuous.
Let $(a,b)$ be an open iterval of $\mathbb{R}$. Then $$(1/g)^{-1}((a,b))=\{x \in X\setminus A : 1/g(x) \in (a,b) \}=\{x \in X\setminus A : g(x) \neq 0, \, 1/g(x)\in (a,b) \}=\{x\in X\setminus A : g(x) =y,\, y\neq 0, 1/y \in (a,b) \}=\{x \in X\setminus A: g(x) \in O  \}=(g\restriction_{X\setminus A})^{-1}(O),$$ being: $$O=\{y \in \mathbb{R} : y\neq 0, \, 1/y \in (a,b) \}=\{y \in \mathbb{R}\setminus \{0\} : 1/y \in (a,b) \}=\{y \in \mathbb{R}\setminus \{0\} : h(y) \in (a,b) \}=h^{-1}((a,b)).$$ But as we said, $h$ is continuous. Hence $O$ is open in $\mathbb{R}$. From $(1/g)^{-1}((a,b))=(g\restriction_{X\setminus A})^{-1}(O)$ and from the continuity of $g\restriction_{X\setminus A}$ (every restriction of a continuous function is continuous) we deduce that $(1/g)^{-1}((a,b))$ is open in $X\setminus A$. Since the open intervals are a basis of the usual topology of $\mathbb{R}$, this shows that $1/g$ is continuous $X\setminus A \to \mathbb{R}$.
Now, $f \restriction_{X\setminus A}$ is continuous because $f$ is continuous. Hence we are done if we prove that the product of two continuous functions $i,j \colon Y \to \mathbb{R}$ is continuous, being $Y$ a topological space.
The map $k\colon Y \ni y \mapsto (i(y),j(y))\in \mathbb{R}^2$ is continuous: if $(a,b)$ and $(c,d)$ are open intervals of $\mathbb{R}$ it is the case that $k^{-1}((a,b)\times (c,d))=i^{-1}((a,b))\cap j^{-1}((c,d))$, which is open. Moreover the open sets of the form $(a,b)\times (c,d)$ are a basis of the product topology of $\mathbb{R}^2$. Hence $k$ is continuous $Y \to \mathbb{R}^2$. Finally, as: $$(Y \xrightarrow{ij} \mathbb{R})=(Y\xrightarrow{k} \mathbb{R}^2\xrightarrow{h'}\mathbb{R}) $$ we conclude that $ij$ is continuous, as it is a composition of continuous functions.
