Anyone back then working on anything that had anything to do with calculus or related topics could hardly avoid making mistakes, since there simply was no logically coherent formulation of the basic definitions at that time. Trying to prove something about continuous functions without a *definition* of continuity is going to lead to problems.

Fourier in particular is famous for stating that any periodic function is equal to the sum of its Fourier series. This is nonsense (see the **comment** below). But it's one of the all-time great errors. Trying to make sense of this, to see what could actually be *proved* in this direction, was one motivation for the development of modern rigorous analysis. In fact sorting this out was part of the motivation for at least three major developments that spring to mind:

People like Cauchy, Weierstrass *et al* invent epsilons and deltas. Now we can actually state and prove things about calculus rigorously.

But the theory of Fourier series, although it now made sense logically, still didn't work as well as we'd like; Lebesgue and others invent the Lebesgue integral and the theory of Fourier series gets a big boost.

- Cantor was actually led to set theory, in particular transfinite numbers, in the course of investigations into Fourier series! (When you're studying sets of uniqueness for trig series the notion of the "derived set" $E'$ of $E$ comes up; this is the set of limit points of $E$. Then one can consider $E''$, etc; this leads naturally to a study of $E^\alpha$ for infinite ordinals $\alpha$.)

(The first two items above are hugely well known. For more on the third, regarding Cantor, set theory and Fourier series, you might look here or here. Will R suggests you look here; I haven't seen that, internet too slow for YouTube, but a lecture by Walter Rudin on the topic is certain to be great.)

**Comment** I had no idea that the assertion that there exists a (continuous) function with a divergent Fourier series would be controversial. Writing down an explicit example is not easy; any continuous function that Fourier ever encountered *does* have a convergent Fourier series.

But proving the existence is very simple, from the right point of view. Say $s_n(f)$ is the $n$-th partial sum of the Fourier series for $f$ and $D_n$ is the Dirichlet kernel, so that $$s_n(f)(0)=\frac1{2\pi}\int_0^{2\pi}f(t)D_n(t)\,dt.$$The norm of $s_n(f)(0)$ as a linear functional on $C(\Bbb T)$ is the same as the norm of $D_n$ regarded as a complex measure, which is in turn equal to $\|D_n\|_1$. It's easy to see that $\|D_n\|_1\ge c\log n$. So the Uniform Boundedness Principle, aka the Banach-Steinhaus Theorem, shows that there exists $f\in C(\Bbb T)$ such that $s_n(f)$ is unbounded.