Existence of primitive for continuous function on an open interval $(a,b)$ Show that any continuous function on an open interval has a primitive on that interval.
My approach: This result is elementary if we replace open interval by closed interval.
Fact: Indeed, if the function $f$ is continuous on $[a,b]$ then the function $F:[a,b]\to \mathbb{R}$ defined by $x\mapsto \int_{a}^{x}f(t)dt$  is continuous on $[a,b]$ and $F'(x)=f(x)$ on $[a,b]$.
Assume that our function $f(x)$ is continuous on $(0,1)$. For each $\delta\in (0,1/2)$ we know that $[\delta,1-\delta]\subset (0,1)$ and $f(x)$ is continuous on $[\delta,1-\delta]$. Hence by fact it has a primitive $F_{\delta}:[\delta,1-\delta]\to \mathbb{R}$ such that $F_{\delta}$ is continuous on $[\delta,1-\delta]$ and $F'_{\delta}(x)=f(x)$ on $[\delta,1-\delta]$.
For each $x\in (0,1)$ there are infinitely many $\delta>0$ such that $x\in (\delta,1-\delta)$. So by Axiom of Choice for each $x\in (0,1)$ we can assign $\delta(x)>0$ such that $x\in (\delta(x),1-\delta(x))$.
Thus define the function $F:(0,1)\to \mathbb{R}$ by $x\mapsto F_{\delta(x)}(x)$ and this function has all desired properties.
I was wondering is this solution correct?
At least I cannot find any mistakes in my reasoning.
So I'd be vert grateful if you can take a look and check it.
EDIT: Suppose that $f$ is continuous on $(0,1)$. Take $r>0$ such that $[r,1-r]\subset (0,1)$ and $f$ being continuous on $[r,1-r]$ has a primitive say $G(t)$, i.e. $G(t)$ is continuous on $[r,1-r]$ and $G'(t)=f(t)$ on $[r,1-r]$.
For any $x\in (0,1)$ we assign $\delta_x>0$ such that $x\in (\delta_x,1-\delta_x)$. This can be done by Axiom of Choice.
On each such closed interval $[\delta_x,1-\delta_x]$ the function $f$ has a primitive $\hat{F}_{\delta_x}$. We note that $\hat{F}_{\delta_x}-G\equiv c_x$ on $[\alpha,1-\alpha]$, where $\alpha=\max\{r,\delta_x\}$ and $c_x$ is a constant but it "depends" on $x$.
Define a function $F_{\delta_x}:[\delta_x,1-\delta_x]\to \mathbb{R}$ by $F_{\delta_x}:=\hat{F}_{\delta_x}-c_x$.
I guess our primitive is gonna be the function $P:(0,1)\to \mathbb{R}$ defines as $P(x):=F_{\delta_x}(x)$. However, I have some technical issues to prove that it continuous on $(0,1)$ and its derivative is $f$ for all $x\in (0,1)$.
 A: Your construction is almost there, but not quite. It is not yet certain that $F$ is indeed the primitive of $f$.

For example, take $f(x)=1$ on $[0,1]$.
Then, take $$F_{\delta(x)} = \begin{cases}x\mapsto x& x\geq \frac12\\ x\mapsto x+1&x<\frac12\end{cases}$$
If your choice of $F_{\delta(x)}$ is the one described above, then $F$ is not continuous at $x=\frac12$, and so it is not differentiable on $(0,1)$, and it is not the primitive of $f$.

You need some more work in actually selecting $F_{\delta(x)}$. Not a lot more, you just need to make sure all the primitives "line up", which you can do since you have a constant factor to play around with.

Edit:
Your new solution's construction looks better, and avoids the problem I describe above. Now, as you say, all you need is to prove that $P$ is continuous.
But this is simple, because think about what you created by your new construction.
Take, for example, any two values $x_1, x_2\in(0,1)$. Then there exists some $\delta_1, \delta_2$ such that $x_i\in(\delta_i, 1-\delta_i)$ for $i=1,2$. Without loss of generality, let's assume $\delta_1<\delta_2$.
Then, it should be simple to see that $F_{\delta_1}|_{(\delta_2, 1-\delta_2)} \equiv F_{\delta_2}$, that is, the two functions are identical. You can see that because

*

*both functions are primitives of the same function, which means they may only differ by a constant

*the two functions match on at least one point (by construction).

This means that on any interval $(\delta, 1-\delta)$, the function $P$ is identically equal to the function $F_{(\delta, 1-\delta)}$, and so in particular, that means $P$ is continuous at all points of $(0,1)$.
A: First, following the completeness of $\mathbb{R}$, we can always find some $r\in(a,b)$. Then for any $x\in(a,b)$, the closed interval $[x,r]$ or $[r,x]$ are subset of $(a,b)$, thus $f$ is continuous on them and we can define
$$\mathcal{F}(x)=\int_{r}^{x}f(t)\mathrm{d} t$$
with the identity $\int_{x}^{r}f(t)\mathrm{d} t=-\int_{r}^{x}f(t)\mathrm{d} t$, this function is defined for all $x\in(a,b)$. Now we prove it is continuous on $(a,b)$ and $\mathcal{F}'(x)=f(x)$:
\begin{align*}
 &\mathcal{F}(x+h)-\mathcal{F}(x)=\int_{r}^{x+h}f(t)\mathrm{d} t-\int_{r}^{x}f(t)\mathrm{d} t\\
 =&\int_{r}^{x}f(t)\mathrm{d} t+\int_{x}^{x+h}f(t)\mathrm{d} t-\int_{r}^{x}f(t)\mathrm{d} t\\
 =&\int_{x}^{x+h}f(t)\mathrm{d} t
\end{align*}
Let $\Delta(t)=f(x)-f(t)\Rightarrow f(t)=f(x)-\Delta(t)$. Since $f$ is continuous on $(a,b)$, we claim that
$$\lim_{t\to x}f(t)=f(x)\Rightarrow\lim_{t\to x}\Delta(t)=\lim_{t\to x}\left(f(x)-f(t)\right)=0$$
Therefore
\begin{align*}
 &\int_{x}^{x+h}f(t)\mathrm{d} t=\int_{x}^{x+h}\left(f(x)-\Delta(t)\right)\mathrm{d} t\\
 =&\int_{x}^{x+h}f(x)\mathrm{d} t-\int_{x}^{x+h}\Delta(t)\mathrm{d} t\\
 =&f(x)\cdot h-\int_{x}^{x+h}\Delta(t)\mathrm{d} t
\end{align*}
Since $t\in[x,x+h]$, we have
$$h\to 0\Rightarrow f(x+h)\to f(x)\Rightarrow f(t)\to f(x)\Rightarrow \Delta(t)\to 0$$
which means $\Delta(t)$ is an infinitesimal of $h$, so we write
$$\mathcal{F}(x+h)-\mathcal{F}(x)=\int_{x}^{x+h}f(t)\mathrm{d} t=f(x)\cdot h-\alpha(h)\cdot h$$
This simultaneously indicates that (1) as $h\to 0$, $\mathcal{F}(x+h)-\mathcal{F}(x)\to 0$, so $\mathcal{F}(x)$ is continuous at $x$ (hence continuous on $(a,b)$, even though may not be uniformly continuous); (2) $\mathcal{F}'(x)=f(x)$ because this is exactly the definition of derivative.
It is quite obvious that select a different $r_{1}$ results in a primitive that differs from this one by the constant $\int_{r}^{r_{1}}f(t)\mathrm{d}t$
