Integral with smaller sigma algebra Here's an exercise: 
Let $(X,M,\mu)$ be a measure space with $\mu(X)<\infty$. Let $N\subseteq M$ be a $\sigma$-algebra. If $f\geq 0$ is $M$-measurable and $\mu$-integrable, then there exists some $N$-measurable and $\mu$-integrable function $g\geq 0$ such that 
$$
\int_E g \, d\mu=\int_E f \, d\mu,~~~~E\in N.
$$
My proof does not involve the finite measure property: 
Let $E\in N$, define 
$$
{\frak{A}}_E = \left\{\sum_{k=1}^n a_k \mu(E_k): a_k \geq 0, E_k \in N, \biguplus_{k=1}^{n_m}E_k^{(m)} = E, \sum_{k=1}^n a_k \chi_{E_k} \leq f, k=1,\ldots,n, n\in {\bf N}\right\}.
$$
In particular, for $E=X$, find some sequence $(s_{m})$ that of the form 
\begin{align*}
s_m=\sum_{k=1}^{n_m} a_k^{(m)} \chi_{E_k^{(m)}}\leq f,~~~~a_{k}^{(m)}\geq 0,~~~~E_k^{(m)}\in N,~~~~\biguplus_{k=1}^{n_m}E_k^{(m)}=X,~~~~k=1,\dots,n_m,
\end{align*}
where $n_m \in{\bf{N}}$, $m=1,2,\ldots$ such that 
\begin{align*}
(N)\int_X s_m \, d\mu=\sum_{k=1}^{n_m} a_k^{(m)} \mu\left(E_k^{(m)}\right)\rightarrow \sup{\frak{A}}_X
\end{align*}
as $m\rightarrow\infty$, where the notation $(N)$ indicates that the integration is taken under the measure space $(X,N,\mu)$, $\displaystyle\biguplus$ means that the union is disjoint. We note that as $f$ is $\mu$-integrable, we have $\sup{\frak{A}}_{E}<\infty$ for each $E\in N$, and hence $\sup{\frak{A}}_E + \sup{\frak{A}}_{E^c} \leq \sup{\frak{A}}_X$, so
$$
(N)\int_E s_m \, d\mu=(N)\int_X s_m \, d\mu-(N)\int_{E^c} s_m \, d\mu\geq(N)\int_X s_m \, d\mu-\sup{\frak{A}}_{E^c},
$$
and hence 
$$
\liminf_{m\rightarrow\infty}\left[(N)\int_E s_m \, d\mu\right] \geq \sup{\frak{A}}_X -\sup{\frak{A}}_{E^c}\geq\sup{\frak{A}}_E.
$$
Since 
$$
\int_E s_m \, d\mu\leq\sup{\frak{A}}_E,
$$
we deduce that
$$
\lim_{m\rightarrow\infty} \left[(N)\int_E s_m \, d\mu\right]=\sup{\frak{A}}_E.
$$
By construction $s_{m}$ is $N$-measurable, if we let $g(x)=\limsup_{m\rightarrow\infty}s_{m}(x)$, we have $g\geq 0$ is $N-$measurable. Since $s_m \leq f$ for each $m=1,2,\ldots$, if we view $s_{m}$ as $M$-measurable, a varied Fatou's Lemma gives 
\begin{align*}
\limsup_{m\rightarrow\infty}\left[(M)\int_E s_m \, d\mu\right] \leq (M) \int_E \limsup_{m\rightarrow\infty} s_m \, d\mu=(M)\int_E g \, d\mu,
\end{align*}
since 
\begin{align*}
(M)\int_E s_m \, d\mu=(N)\int_E s_m \, d\mu
\end{align*}
and that 
\begin{align*}
(M)\int_E g \, d\mu \leq (M)\int_E f \, d\mu,
\end{align*}
we conclude that 
\begin{align*}
\sup{\frak{A}}_{E}\leq(M)\int_{E}fd\mu.
\end{align*}
On the other hand, given $b_k\geq 0$, $B_k\in M$, $k=1,\ldots,l$, $\displaystyle\biguplus_{k=1}^l B_k=E$ and that 
$$
b=\sum_{k=1}^l b_k \chi_{B_k}\leq f,
$$
we have
\begin{align*}
b&=\sum_{k=1}^l b_k \chi_{B_k}\\
&=\sum_{k=1}^l b_k \chi_{B_k\cap E}\\
&=\left(\sum_{1\leq k\leq l: B_k \cap E\ne\emptyset} b_k\right)\chi_E,
\end{align*}
if $\{1\leq k\leq l: B_k\cap E\ne\emptyset\}$ is empty, we set
\begin{align*}
\sum_{1\leq k\leq l: B_k\cap E\ne\emptyset}b_k=0,
\end{align*}
so 
\begin{align*}
(M)\int_E b \, d\mu=\left(\sum_{1\leq k\leq l: B_k\cap E \ne \emptyset} b_k \right)\mu(E) \leq \sup{\frak{A}}_E,
\end{align*}
since $(M)\displaystyle\int_E f \, d\mu$ is defined by the supremum of the set of all such integrals of $b$ taken in $(X,M,\mu)$, we find that 
\begin{align*}
(M)\int_E f \, d\mu \leq \sup{\frak{A}}_E,
\end{align*}
the result follows.
Can anyone point out the mistakes in this proof, if they exist?
 A: NEW: In fact the result always fails unless the restriction $\mu|_N$ is $\sigma$-finite. See below.
First the simple counterexample showing that the result may fail without some finiteness hypothesis:
Without the assumption that $\mu(X)<\infty$ the result is false. Simple counterexample:
Say $(X,M,\mu)=(\Bbb R,M,m)$, where $M$ is the algebra of Lebesgue measurable sets and $m$ is Lebesgue measure. Say $f=\chi_{[0,1]}$, and $N=\{\Bbb R,\emptyset\}$. An $N$-measurable function must be constant.
So the result you say you've proved would show that there is a constant $c$ with $$\int_{\Bbb R}c\,dx=1,$$clearly impossible.
Comment. If we assume that $\mu(X)<\infty$ then the result is a simple standard application of the Radon-Nikodym theorem. We need $\mu(X)<\infty$ because of the $\sigma$-finiteness hypothesis in R-N. So one might think that assuming that $\mu$ is $\sigma$-finite would be enough. Not so.  Curiously, although assuming $\mu$ finite certainly implies that the restriction of $\mu$ to $N$ is finite, assuming $\mu$ is $\sigma$-finite does not imply that the restriction of $\mu$ to $N$ is $\sigma$-finite (as the example shows).

NEW
First two simple general measure-theory exercises:
Exercise The measure $\mu$ is $\sigma$-finite if and only if there exists $f\in L^1(\mu)$ with $f>0$ almost everywhere.
Exercise A measurable function $f$ is strictly positive almost everywhere if and only if $\int_E f\,d\mu>0$ for every measurable set $E$ with $\mu(E)>0$.
Theorem Suppose that $(X,M,\mu)$ is a $\sigma$-finite measure space and $N$ is a sub-$\sigma$-algebra of $M$. The following are equivalent:
(i) There exist sets $E_n\in N$ with $\mu(E_n)<\infty$ and $\bigcup E_n=X$.
(ii) For every $f\in L^1(\mu)$ there exists an $N$-measurable function $g$ such that $\int_Eg\,d\mu=\int_Ef\,d\mu$ for every $E\in N$.
Proof One direction is perfectly standard. Assume (i). That says that $\mu|_N$ is $\sigma$-finite. Define $\nu:N\to\Bbb C$ by $\nu(E)=\int_E f\,d\mu$. Then $\nu$ is a complex measure on $N$ and $\nu<<\mu|_N$, so Radon-Nikodym says that there exists $g\in L^1(\mu|_N)$ with $\nu(E)=\int_E g\,d\mu$ for all $E\in N$.
Now assume (ii). Since $\mu$ is $\sigma$-finite there exists $f\in L^1(\mu)$ with $f>0$ almost everywhere. Choose $g\in L^1(\mu|_N)$ as in (ii). Now if $E\in N$ and $\mu(E)>0$ then $\int_E g\,d\mu=\int_Ef\,d\mu>0$, since $f>0$ almost everywhere. Hence $g>0$ almost everywhere. Hence $\mu|_N$ is $\sigma$-finite. QED.
A: For $E \in N$, let
$$
\lambda(E) = \int_E f\, d\mu.
$$
Then the measure $\lambda$ on $N$ is absolutely continuous to the measure $\mu$ on $N$ (i.e. the restriction to $N$ of the measure $\mu$ on $M$).  Therefore by the Radon–Nikodym theorem, there is an $N$-measurable function $g=\dfrac{d\lambda}{d\mu}$ such that for $E\in N$ we have
$$
\lambda(E) = \int_E g\,d\mu = \int_E f\,d\mu.
$$
