f(x) isn't continous, but |f(x)| is I was working with this problem:

$f(x) = 1, x \in(-\infty,0)\cup(0,\infty)\\
f(x)  = -1, x = 0 $
The absolute value would yield us the function: $|f(x)| = 1, \forall x\in(-\infty,\infty)$
Hence, it'd become continous everywhere.
Thank you for any feedback. And as a side question, is there a way to find more such functions, in an easy way?
 A: In general, anytime you have a function whose absolute value is already continuous (whether or not it is continuous other than abs),  $g: x \in \Bbb X\mapsto g(x)$; $g(x)$ is not identically $0$, $c:|c|=1; c\not = 1$, and some proper subset $\Bbb Y$ of $\Bbb X, \Bbb Y \neq \emptyset, f(\Bbb Y)$ and $f(\Bbb X \setminus \Bbb Y)$ are not identically $0$, you can make your function $f$ have this property by defining it to be:
$f(x) = \begin{cases}
                                   g(x) & \text{if $x\in \Bbb{Y}$} \\
                                   cg(x) & \text{if $x \in \Bbb{X \setminus Y}$} \\ \end{cases}$
If you are working only in the real numbers, it will be $\Bbb X =\Bbb R $ and your $c$ will be $-1$.
A: A simple example is
$$f(x)=
\begin{cases}
-1, & x < 0\\
1, & x \ge 0
\end{cases},
$$
which is not continuous at $x=0$, but $|f(x)|= 1, x \in \mathbb{R}$. More generally, just take any non negative continuous function and swap its sign in points where it is not zero.
A: What about
$$f(x)=\begin{cases}x & \text{if }x\in\mathbb{Q} \\ -x & \text{if }x\in\mathbb{R}-\mathbb{Q} \end{cases}$$
Just separe points of domain on rationals and irrationals and give them opposite aditive functions, as this way you can have a lot of functions with the properties you ask
