---
tag: 0RXK2Z808Q
kind: counterexample
name: A continuous nowhere differentiable function
msc: [26A27]
uses: [0NX5NWAFC9, 0R0MYT0BJD, 0A61B60B5R]
sources:
  - url: https://en.wikipedia.org/wiki/Weierstrass_function_(nowhere-differentiable_function)
    locator: Construction
---

## Counterexample

Let $\varphi \colon \mathbb{R} \to \mathbb{R}$ be the zigzag function with $\varphi(x) = |x|$ for $-1 \le x \le 1$ and $\varphi(x + 2) = \varphi(x)$ for all $x$.
Define
$$f(x) = \sum_{n=0}^{\infty} \Big( \frac{3}{4} \Big)^n \varphi(4^n x).$$
The function $f$ is continuous on $\mathbb{R}$, but it is not [[differentiable|0A61B60B5R]] at any point.

## Remarks

Since $0 \le \varphi \le 1$, the [[M-test|0NX5NWAFC9]] with $M_n = (3/4)^n$ and the [[continuity of uniform sums|0R0MYT0BJD]] give continuity.
Fix $x$. For each $m$, choose $\delta_m = \pm \frac{1}{2} 4^{-m}$ so that no integer lies strictly between $4^m x$ and $4^m (x + \delta_m)$.
Then $\Big| \frac{f(x + \delta_m) - f(x)}{\delta_m} \Big| \ge \frac{3^m + 1}{2}$. This tends to infinity while $\delta_m \to 0$, so $f'(x)$ does not exist.
This function replaces the cosine in the [[Weierstrass function|01A0MK1730]] by a piecewise linear zigzag.

## Explanations

### L1 human

Each term adds smaller and steeper zigzags to the graph.
The sum is continuous, but its graph has a corner at every scale near every point.
