[proofplan]
We prove the identity by expanding the integral over the unit intervals on which the partial-sum function is constant. On each interval $[k,k+1)$ the value of $A(t)$ is the finite partial sum $A_k=\sum_{n=1}^k a_n$, so the integral against $f'$ becomes a finite sum of differences $A_k(f(k+1)-f(k))$. Rearranging this finite sum telescopes and leaves exactly the weighted sum $\sum_{n=1}^N a_n f(n)$.
[/proofplan]
[step:Introduce finite partial sums and reduce the integral to unit intervals]
For each integer $k$ with $1\le k\le N$, define
\begin{align*}
A_k:=\sum_{n=1}^k a_n.
\end{align*}
Then $A(N)=A_N$. If $N=1$, the integral over $[1,1]$ is $0$, and the claimed identity reduces to $a_1f(1)=A_1f(1)$.
Assume now that $N\ge 2$. For each integer $k$ with $1\le k\le N-1$, the definition of $A$ gives $A(t)=A_k$ for every $t\in[k,k+1)$. Since changing a bounded function at finitely many points does not change its [Lebesgue integral](/page/Lebesgue%20Integral) with respect to $\mathcal L^1$, and since $A f'$ is integrable on $[1,N]$ because $A$ is bounded and $f'$ is continuous, we obtain
\begin{align*}
\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
\sum_{k=1}^{N-1} A_k\int_k^{k+1} f'(t)\,d\mathcal L^1(t).
\end{align*}
For each such $k$, the one-dimensional [fundamental theorem of calculus](/theorems/632) for the continuously differentiable function $f$ gives
\begin{align*}
\int_k^{k+1} f'(t)\,d\mathcal L^1(t)=f(k+1)-f(k).
\end{align*}
Therefore
\begin{align*}
\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
\sum_{k=1}^{N-1} A_k\bigl(f(k+1)-f(k)\bigr).
\end{align*}
[guided]
We introduce a notation that separates the jump sizes $a_n$ from the accumulated sums. For each integer $k$ with $1\le k\le N$, define
\begin{align*}
A_k:=\sum_{n=1}^k a_n.
\end{align*}
Thus $A_k$ is the value attained by the step function after the $k$-th jump, and in particular $A(N)=A_N$.
First consider the endpoint case $N=1$. The interval $[1,1]$ has $\mathcal L^1$-measure $0$, so
\begin{align*}
\int_1^1 A(t)f'(t)\,d\mathcal L^1(t)=0.
\end{align*}
The asserted identity becomes
\begin{align*}
a_1f(1)=A_1f(1),
\end{align*}
which follows from the definition $A_1=a_1$.
Now assume $N\ge 2$. The point of the proof is that $A$ is constant between consecutive integers. If $t\in[k,k+1)$ for an integer $k$ with $1\le k\le N-1$, then the integers $n$ satisfying $1\le n\le N$ and $n\le t$ are exactly $1,\dots,k$. Hence
\begin{align*}
A(t)=\sum_{n=1}^k a_n=A_k.
\end{align*}
The values of $A$ at the finitely many endpoints $2,\dots,N-1$ do not affect the Lebesgue integral, because finite subsets of $\mathbb R$ have $\mathcal L^1$-measure $0$. Also, $A$ is bounded because it takes only finitely many values, and $f'$ is continuous on the compact interval $[1,N]$, so the product $A f'$ is Lebesgue integrable. Therefore we may split the integral over the finite partition into unit intervals:
\begin{align*}
\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
\sum_{k=1}^{N-1} A_k\int_k^{k+1} f'(t)\,d\mathcal L^1(t).
\end{align*}
For each $k$, the function $f$ is continuously differentiable on $[k,k+1]$. The one-dimensional fundamental theorem of calculus applies and gives
\begin{align*}
\int_k^{k+1} f'(t)\,d\mathcal L^1(t)=f(k+1)-f(k).
\end{align*}
Substituting this identity into the finite sum yields
\begin{align*}
\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
\sum_{k=1}^{N-1} A_k\bigl(f(k+1)-f(k)\bigr).
\end{align*}
[/guided]
[/step]
[step:Substitute the jump relation and telescope the finite sum]
For every integer $k$ with $2\le k\le N$, the partial sums satisfy
\begin{align*}
a_k=A_k-A_{k-1}.
\end{align*}
Using the expression from the previous step, we compute
\begin{align*}
A_Nf(N)-\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
A_Nf(N)-\sum_{k=1}^{N-1}A_k\bigl(f(k+1)-f(k)\bigr).
\end{align*}
Expanding the right-hand side gives
\begin{align*}
A_Nf(N)-\sum_{k=1}^{N-1}A_k f(k+1)+\sum_{k=1}^{N-1}A_k f(k).
\end{align*}
The terms with $f(j)$ for $2\le j\le N-1$ have coefficient $A_j-A_{j-1}$, the term with $f(1)$ has coefficient $A_1$, and the term with $f(N)$ has coefficient $A_N-A_{N-1}$. Hence
\begin{align*}
A_Nf(N)-\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
A_1f(1)+\sum_{j=2}^{N-1}(A_j-A_{j-1})f(j)+(A_N-A_{N-1})f(N).
\end{align*}
Using $A_1=a_1$ and $A_j-A_{j-1}=a_j$ for $2\le j\le N$, this becomes
\begin{align*}
A_Nf(N)-\int_1^N A(t)f'(t)\,d\mathcal L^1(t)
=
\sum_{j=1}^N a_j f(j).
\end{align*}
This is exactly the desired partial summation identity.
[/step]