Prove $g(x)=3x+2$ and $h(x)=\text{sgn}(x)$ dis/continuous using topological definition. Let $f:X\rightarrow Y$ be a function between topological spaces with topologies $\mathscr{T}$ and $\mathscr{U}$ respectively. $f$ is said to be continuous if when $f^{-1}(V)\in\mathscr{T}~~\forall ~~V\in\mathscr{U}$. Using this definition, show that $$g,h:\mathbb{R}\rightarrow\mathbb{R}, ~~g(x):=3x+2, ~~h(x):=\text{sgn}(x)$$
are continuous and not continuous respectively. 
PART 1:
Here is my attempt. Any open subset of $\mathbb{R}$ can be represented by the union of open subsets of the form (a,b). So we take the metric topology (with the Euclidean metric) on $\mathbb{R}$ and let 
$V=\cup_{i\in I}(3a_i+2,3b_i+2)$ where $I$ is an indexing set.
Now $f^{-1}(V)=(a_i,b_i)$. Let $x\in f^{-1}(V)$, then take $\varepsilon=\text{min}\{d(x,a_i),d(x,b_i)\}$, then $B_{\varepsilon}(x)\subseteq f^{-1}(V)$. Thus $f^{-1}\in\mathbb{R}$ whenever $V\in\mathbb{R}$ and g is continuous. 
PART 2:
I'm not sure how to go about this one. I know I need to find a set in the codomain which is open whose corresponding pre-image is not open for a counter example, But im not sure how.. I'm quite sure it should be easy.
EDIT TO PART 1
Let $V_i=(3a_i+2,3b_i+2)$ and Let $V=\cup_{i\in I}~V_i$ (should I define the V_i's so that there is no intersection between them?). Now $g^{-1}(V)=\cup_{i\in I}~(a_i,b_i)$. Let $x\in g^{-1}(V)$, take $\varepsilon_k = \text{min}\{d(x,a_i),d(x,b_i);\forall i\in I\}$, then $B_{\varepsilon_k}(x)\subseteq g^{-1}(V)$. Thus $g^{-1}(V)\in\mathbb{R}$ whenever $V\in\mathbb{R}$ and $g$ is continuous. 
 A: Looking at the graph of $h$, you can see that that the point $(0,0)$ is "by itself", as in, it is not close to any other points on the graph. Therefore, there should be some open neighborhood $U$ of $0$ (in the codomain) such that $f^{-1}(U)$ only contains $0$ (in the domain), making it a singleton set, and therefore not open. In fact, just making the neighborhood small enough would be sufficient. Can you think of a $U$ that does the trick?
If you're still stuck, here's a similar example. Let $f(x) = x/2$ for $x\neq 5$, and $f(5) = 10$. Then $U=(9.9, 10.1)$ is open, and $f^{-1}(U) = \{5\}\bigcup \left(19.8, 20.2\right)$, which is not open, so $f$ is not continuous. 
A: Hints:


*

*Since your $g$ has a very explicit inverse, $g^{-1}(a,b)$ can be very explicitly calculated.

*You know $\operatorname{sgn}$ has a jump at $0$. Therefore, there should be an (open) neighbourhood of $f(0)$ whose preimage is not open.
A: For an open interval $(-a,a)$ with $a<1$ we have $\sgn^{-1}$ of it being ${0} which is a singleton, however real numbers are hausdorff so a singleton is closed, ergo the inverse image is not in the topology and hence not continuous.
