[proofplan]
We prove exactness directly from the definition of the mapping cone. First we verify that $i$ and $p$ are chain maps, so that they induce maps on homology. Then we compute the kernel of each displayed homology map: the cone boundary formula shows that $\ker H_n(p)=\operatorname{im} H_n(i)$, that $\ker H_{n-1}(f)=\operatorname{im} H_n(p)$, and that $\ker H_{n-1}(i)=\operatorname{im} H_{n-1}(f)$. Since these three identities hold in every degree, they assemble into the long exact sequence.
[/proofplan]
[step:Verify that the inclusion and projection are chain maps]
For each $n \in \mathbb{Z}$, define the $R$-linear maps
\begin{align*}
i_n: D_n &\to \operatorname{Cone}(f)_n, & y &\mapsto (y,0),
\end{align*}
and
\begin{align*}
p_n: \operatorname{Cone}(f)_n &\to C_{n-1}, & (y,x) &\mapsto x.
\end{align*}
The shifted complex $C[-1]$ has degree-$n$ term $C_{n-1}$ and differential $-\partial^C_{n-1}: C_{n-1}\to C_{n-2}$. Thus $p$ is a map $\operatorname{Cone}(f)\to C[-1]$.
For $y\in D_n$,
\begin{align*}
\partial^{\operatorname{Cone}}_n i_n(y)
&= \partial^{\operatorname{Cone}}_n(y,0)\\
&= \bigl(\partial^D_n y + f_{n-1}(0),-\partial^C_{n-1}0\bigr)\\
&= \bigl(\partial^D_n y,0\bigr)\\
&= i_{n-1}(\partial^D_n y).
\end{align*}
Therefore $i: D\to \operatorname{Cone}(f)$ is a chain map.
For $(y,x)\in \operatorname{Cone}(f)_n$, we compute
\begin{align*}
p_{n-1}\partial^{\operatorname{Cone}}_n(y,x)
&= p_{n-1}\bigl(\partial^D_n y+f_{n-1}(x),-\partial^C_{n-1}x\bigr)\\
&= -\partial^C_{n-1}x.
\end{align*}
This is exactly the differential of $C[-1]$ applied to $p_n(y,x)=x$. Hence $p:\operatorname{Cone}(f)\to C[-1]$ is a chain map.
Consequently $i$ and $p$ induce homology maps
\begin{align*}
H_n(i):H_n(D)&\to H_n(\operatorname{Cone}(f)),\\
H_n(p):H_n(\operatorname{Cone}(f))&\to H_n(C[-1])\cong H_{n-1}(C).
\end{align*}
Under the identification $H_n(C[-1])\cong H_{n-1}(C)$, the map $H_n(p)$ sends a cone homology class $[(y,x)]$ to $[x]\in H_{n-1}(C)$.
[guided]
We first check that the maps in the displayed sequence are actually defined on homology. The inclusion map is the degreewise $R$-[linear map](/page/Linear%20Map)
\begin{align*}
i_n: D_n &\to \operatorname{Cone}(f)_n, & y &\mapsto (y,0).
\end{align*}
Using the cone differential, for every $y\in D_n$ we have
\begin{align*}
\partial^{\operatorname{Cone}}_n i_n(y)
&= \partial^{\operatorname{Cone}}_n(y,0)\\
&= \bigl(\partial^D_n y+f_{n-1}(0),-\partial^C_{n-1}0\bigr)\\
&= \bigl(\partial^D_n y,0\bigr)\\
&= i_{n-1}(\partial^D_n y).
\end{align*}
So $i$ commutes with differentials and is a chain map.
The projection is slightly subtler because it lands in a shifted complex. Define
\begin{align*}
p_n: \operatorname{Cone}(f)_n &\to C_{n-1}, & (y,x) &\mapsto x.
\end{align*}
The target is $C[-1]$, whose degree-$n$ group is $C_{n-1}$ and whose degree-$n$ differential is $-\partial^C_{n-1}$. Therefore, to prove that $p$ is a chain map, we must check that projecting after taking the cone boundary gives $-\partial^C$ on the $C$-component. Indeed,
\begin{align*}
p_{n-1}\partial^{\operatorname{Cone}}_n(y,x)
&= p_{n-1}\bigl(\partial^D_n y+f_{n-1}(x),-\partial^C_{n-1}x\bigr)\\
&= -\partial^C_{n-1}x.
\end{align*}
This equals the shifted differential applied to $p_n(y,x)=x$. Hence $p:\operatorname{Cone}(f)\to C[-1]$ is a chain map.
Since chain maps send cycles to cycles and boundaries to boundaries, both $i$ and $p$ induce homology maps. Finally, because $H_n(C[-1])$ is naturally identified with $H_{n-1}(C)$, the map $H_n(p)$ sends a class represented by a cone cycle $(y,x)\in D_n\oplus C_{n-1}$ to the class $[x]\in H_{n-1}(C)$.
[/guided]
[/step]
[step:Identify the kernel of $H_n(p)$ with the image of $H_n(i)$]
Let $[(y,x)]\in H_n(\operatorname{Cone}(f))$, represented by a cone cycle $(y,x)\in D_n\oplus C_{n-1}$. The cycle condition is
\begin{align*}
\partial^D_n y + f_{n-1}(x) &= 0,\\
\partial^C_{n-1}x &= 0.
\end{align*}
First suppose $[(y,x)]\in \operatorname{im} H_n(i)$. Then there is a cycle $z\in D_n$ such that $[(y,x)]=[(z,0)]$, so
\begin{align*}
H_n(p)([(y,x)])=H_n(p)([(z,0)])=[0]=0.
\end{align*}
Thus $\operatorname{im}H_n(i)\subseteq \ker H_n(p)$.
Conversely, suppose $[(y,x)]\in \ker H_n(p)$. Then $[x]=0$ in $H_{n-1}(C)$, so there exists $a\in C_n$ such that $x=\partial^C_n a$. Define
\begin{align*}
z := y+f_n(a)\in D_n.
\end{align*}
Because $f$ is a chain map,
\begin{align*}
\partial^D_n z
&= \partial^D_n y+\partial^D_n f_n(a)\\
&= \partial^D_n y+f_{n-1}(\partial^C_n a)\\
&= \partial^D_n y+f_{n-1}(x)\\
&=0.
\end{align*}
Thus $z$ is a cycle in $D_n$. Also
\begin{align*}
\partial^{\operatorname{Cone}}_{n+1}(0,-a)
&= \bigl(\partial^D_{n+1}0+f_n(-a),-\partial^C_n(-a)\bigr)\\
&= \bigl(-f_n(a),\partial^C_n a\bigr)\\
&= \bigl(-f_n(a),x\bigr).
\end{align*}
Therefore
\begin{align*}
(y,x)-\partial^{\operatorname{Cone}}_{n+1}(0,-a)
&= (y,x)-\bigl(-f_n(a),x\bigr)\\
&= (y+f_n(a),0)\\
&= i_n(z).
\end{align*}
So $[(y,x)]=H_n(i)([z])$, and $\ker H_n(p)\subseteq \operatorname{im}H_n(i)$. Hence
\begin{align*}
\ker H_n(p)=\operatorname{im}H_n(i).
\end{align*}
[/step]
[step:Identify the kernel of $H_{n-1}(f)$ with the image of $H_n(p)$]
Let $[x]\in H_{n-1}(C)$, represented by a cycle $x\in C_{n-1}$ with $\partial^C_{n-1}x=0$.
First suppose $[x]\in \operatorname{im}H_n(p)$. Then there is a cone cycle $(y,x)\in \operatorname{Cone}(f)_n$ representing a class whose image under $H_n(p)$ is $[x]$. The cone cycle condition gives
\begin{align*}
\partial^D_n y+f_{n-1}(x)=0.
\end{align*}
Thus $f_{n-1}(x)=-\partial^D_n y$ is a boundary in $D_{n-1}$, and therefore
\begin{align*}
H_{n-1}(f)([x])=[f_{n-1}(x)]=0.
\end{align*}
So $\operatorname{im}H_n(p)\subseteq \ker H_{n-1}(f)$.
Conversely, suppose $[x]\in \ker H_{n-1}(f)$. Then $f_{n-1}(x)$ is a boundary in $D_{n-1}$, so there exists $y\in D_n$ such that
\begin{align*}
f_{n-1}(x)=-\partial^D_n y.
\end{align*}
Since $\partial^C_{n-1}x=0$, the pair $(y,x)\in D_n\oplus C_{n-1}$ satisfies
\begin{align*}
\partial^{\operatorname{Cone}}_n(y,x)
&= \bigl(\partial^D_n y+f_{n-1}(x),-\partial^C_{n-1}x\bigr)\\
&=(0,0).
\end{align*}
Thus $(y,x)$ is a cone cycle, and
\begin{align*}
H_n(p)([(y,x)])=[x].
\end{align*}
Hence $\ker H_{n-1}(f)\subseteq \operatorname{im}H_n(p)$. Therefore
\begin{align*}
\ker H_{n-1}(f)=\operatorname{im}H_n(p).
\end{align*}
[/step]
[step:Identify the kernel of $H_{n-1}(i)$ with the image of $H_{n-1}(f)$]
Let $[w]\in H_{n-1}(D)$, represented by a cycle $w\in D_{n-1}$ with $\partial^D_{n-1}w=0$.
First suppose $[w]\in \operatorname{im}H_{n-1}(f)$. Then there is a cycle $x\in C_{n-1}$ such that $[w]=[f_{n-1}(x)]$. Since $\partial^C_{n-1}x=0$,
\begin{align*}
\partial^{\operatorname{Cone}}_n(0,x)
&= \bigl(f_{n-1}(x),0\bigr)\\
&= i_{n-1}(f_{n-1}(x)).
\end{align*}
Thus $H_{n-1}(i)([f_{n-1}(x)])=0$, and therefore $[w]\in \ker H_{n-1}(i)$. Hence
\begin{align*}
\operatorname{im}H_{n-1}(f)\subseteq \ker H_{n-1}(i).
\end{align*}
Conversely, suppose $[w]\in \ker H_{n-1}(i)$. Then $[(w,0)]=0$ in $H_{n-1}(\operatorname{Cone}(f))$, so there exists $(y,x)\in \operatorname{Cone}(f)_n=D_n\oplus C_{n-1}$ such that
\begin{align*}
\partial^{\operatorname{Cone}}_n(y,x)=(w,0).
\end{align*}
Expanding the cone differential gives
\begin{align*}
\partial^D_n y+f_{n-1}(x)&=w,\\
-\partial^C_{n-1}x&=0.
\end{align*}
Thus $x$ is a cycle in $C_{n-1}$, and in $H_{n-1}(D)$ we have
\begin{align*}
[w]=[\partial^D_n y+f_{n-1}(x)]=[f_{n-1}(x)].
\end{align*}
Therefore $[w]\in \operatorname{im}H_{n-1}(f)$, so
\begin{align*}
\ker H_{n-1}(i)\subseteq \operatorname{im}H_{n-1}(f).
\end{align*}
We conclude that
\begin{align*}
\ker H_{n-1}(i)=\operatorname{im}H_{n-1}(f).
\end{align*}
[/step]
[step:Assemble the degreewise exactness identities into the long exact sequence]
The previous three steps prove, for every $n\in\mathbb{Z}$,
\begin{align*}
\ker H_n(p)&=\operatorname{im}H_n(i),\\
\ker H_{n-1}(f)&=\operatorname{im}H_n(p),\\
\ker H_{n-1}(i)&=\operatorname{im}H_{n-1}(f).
\end{align*}
These are precisely the exactness conditions at the three consecutive terms
\begin{align*}
H_n(\operatorname{Cone}(f)),\qquad H_{n-1}(C),\qquad H_{n-1}(D).
\end{align*}
Since $n$ was arbitrary, the same argument applies in every degree. Hence the maps assemble into the long exact sequence
\begin{align*}
\cdots \longrightarrow H_n(D) \xrightarrow{H_n(i)} H_n(\operatorname{Cone}(f)) \xrightarrow{H_n(p)} H_{n-1}(C) \xrightarrow{H_{n-1}(f)} H_{n-1}(D) \xrightarrow{H_{n-1}(i)} H_{n-1}(\operatorname{Cone}(f)) \longrightarrow \cdots .
\end{align*}
This proves the theorem.
[/step]