$f$ differentiable on $\Bbb R$ but $f'$ discontinuous at $0$

131 Views Asked by At

An intro-to-analysis exam question today asked for an example of a function $f: \mathbb{R} \to \mathbb{R}$ such that

  • $f$ is differentiable on $\mathbb{R}$
  • $f'$ is discontinuous at $0$

I know now that the standard example is $$ f(x) = \begin{cases} x^2\sin(1/x) & x \neq 0 \\ 0 & x = 0 \end{cases} $$

During the exam, however, I failed to come up with this and instead gave the following response.

Let $g: \mathbb{R} \to \{0,1\}$ be defined by $g(x) = \begin{cases} 1 & x \neq 0 \\ 0 & x = 0 \end{cases}$. Then let $f(x) = \int_0^x g(t)dt$. $g$ is Riemann integrable, having finitely many discontinuities, so the integral is well defined. $f$ is differentiable on $\mathbb{R}$, but $f' = g$ is discontinuous at $0$.

Other than the missing proofs of $f$ differentiable, $f'=g$, is this a valid example? How would I have shown differentiability/$f'=g$ in a straightforward manner (more justify than prove)?

1

There are 1 best solutions below

3
On BEST ANSWER

That's not an example, since $(\forall x\in\mathbb R):f(x)=x$. Therefore, $(\forall x\in\mathbb R):f'(x)=1$; in particular, $f'$ is continuous.

Your error consisted in applying the fundamental theorem of Calculus to a non-continuous function.