Definition of continuous functions Let $D\subset\mathbb{R^n}$ and $R\subset\mathbb{R^m}$ a function $f:D\rightarrow R$ is said to be continuous if  whenever $A$ is an open set in $R$, then $f^{-1}(A)$ is an open set in $D$.
So my question is are $A$ and $f^{-1}(A)$ open relative to $R$ and $D$ respectively or are they just open in $\mathbb{R^m}$ and $\mathbb{R^n}$ in that order??
 A: In the most general setting it is that $A$ is open in $\mathbb{R^{m}}$ and $f^{-1}(A)$ is open in $D$. These are just an equivalent requirement of the epsilon-delta definition. If $A$ is open in $\mathbb{R^{m}}$, then $A$ may or may not be outside the range of $f$; in either case it is still okay to study if $f^{-1}(A)$ is open in $D$ (note that if $A$ lies outside the range of $f$, then $f^{-1}(A) = \varnothing$ is automatically open in $D$.). All in all, recall that the epsilon-delta definition of continuity of $f$ can be rephrased as: for every $c \in D$, the preimage (corresponding to "$f(c) - \varepsilon < f(x) < f(c) + \varepsilon$") of every open ball (corresponding to "for every $\varepsilon > 0$", which determines an open ball of any given center) of center $f(c)$ contains (corresponding to the implication "$c - \delta < x < c + \delta \Rightarrow f(c) - \varepsilon < f(x) < f(c) + \varepsilon$") some open ball (corresponding to "there is some $\delta > 0$") of center $c$. Moreover, you saw why it is required that $f^{-1}(A)$ is open in $D$.
A: Well, your function is only defined on $D$ so you need to ask whether the sets are open in $D$.  However, unless specified otherwise, you can assume that the topology on $D$ is that induced as a subset of $\Bbb{R^n}$.  A little care is needed.  Suppose $n = 1$ and $D = [0, 1]$then $[0, 0.5)$ is an open set in $D$.  Similar considerations apply to $R$.
