0

I was working with this problem:

enter image description here

$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?

Tanamas
  • 1,837
  • 3
    Yea, literally just take any continuous non-zero non-negative function, and negate its value at a point where it is positive. (Your example is an example of this). – Rushabh Mehta Sep 27 '21 at 14:59

3 Answers3

1

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$.

Neptune
  • 420
  • 3
  • 11
1

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.

PierreCarre
  • 20,974
  • 1
  • 18
  • 34
-2

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

L F
  • 3,644
  • 5
    OP already has an example of such a function. OP wants to know if there is an easy construction for many of these sorts of questions. – Rushabh Mehta Sep 27 '21 at 15:00
  • @RushabhMehta you clearly didn't read. I have told him a way to construct many of the sort of functions in a very, veeeryy simple way. – L F Jul 20 '22 at 14:20