Show that if $f(x+y)=g(x)+g(y) $ a.e. then functions are linear Let  $f(x), g(x), h(x)$ be measureable functions such that
\begin{align}
f(x+y)=g(x)+h(y),
\end{align}
almost everywhere $(x,y) \in \mathbb{R}^2$.
Can we show that 
\begin{align}
g(x)&=ax+b_1,\\
h(x)&=ax+b_2,
\end{align}
almost everywhere $(x,y) \in \mathbb{R}^2$ for some $a,b_1,b_2$. 
My attempt:
Which I think is problematic. 
Since, $f(x+y)=g(x)+h(y)$, we have that 
\begin{align}
f(x+0)=g(x)+h(0)\\
f(0+y)=g(0)+h(y)
\end{align}
Now adding the two equations and use our identity we get
\begin{align}
f(x+0)+f(y+0)=g(x)+h(y)+h(0)+g(0)= f(x+y)+f(0).
\end{align}
So, we have that
\begin{align}
f(x)+f(y)=f(x+y)+f(0)
\end{align}
Next, difine a function $\phi(x)=f(x)-f(0)$ and we get 
\begin{align}
\phi(x)+\phi(y)=\phi(x+y).
\end{align}
The above is know as Cauchy's functional equation and if $\phi(x)$ is measureable (which it is since $f$ is measurable) then it must be linear (i.e., $\phi(x)=ax$).
Going backward this shows that $g(x)$ and $h(x)$ are given by \begin{align}
g(x)&=ax+b_1,\\
h(x)&=ax+b_2,
\end{align}
for some $a,b_1,b_2$.
Questions:
1) Is this proof correct?
2) Since, we are assuming that equation $f(x+y)=g(x)+h(y)$ holds almost everywhere and not everywhere. Is this problem?   For example, in the very first step of the proof
\begin{align}
f(x+0)=g(x)+h(0)\\
f(0+y)=g(0)+h(y)
\end{align}
can we do this? Is there problem of choosing $(x,0)$ and $(0,y)$? I think there is a possibility that $(x,0)$ and $(0,y)$ might belong to a set of measure zero on which the equations don't hold. 
3) Another, question very similar to 2). Since,  $\phi(x)+\phi(y)=\phi(x+y)$ holds a.e. can we apply Cauchy equation?
 A: For 2), you're right, this could be a problem. For example, if $f(x) = x$ for $x \neq 0$ and $f(0) = 1$, and $g = h = f$, then the functional equation holds whenever $x, y, x+y$ are all nonzero (so a.e.), but the two equations you get from setting $x = 0$ and $y = 0$ are never true. Since the set of $(x, y)$ such that the equation fails has measure zero, there are some fixed $a, b \in \mathbb{R}$ such that 
$$f(x+a) = g(x) + h(a)$$ 
for a.e. $x$ and 
$$f(b+y) = g(b) + h(y)$$ 
for a.e. $y$. 
This allows you to write $f(x + a) + f(y + b) = f(x+y) + h(a) + g(b)$ for a.e. (x, y) (this only fails when either of the two previous equations fail or where the original functional equation fails). From here we can replace $x$ with $x+b$ and $y$ with $y+a$ to get
$$f(x+a+b) + f(y+a+b) = f(x+y+a+b) + h(a) + g(b)$$
for a.e. (x, y), so if we define $\phi(x) = f(x + a + b) - h(a) - g(b)$, then
$$\phi(x) + \phi(y) = \phi(x+y)$$
for a.e. (x, y). 
Now for 3), De Bruijn has shown that we must have $\phi = \phi_0$ a.e., where $\phi_0$ is a solution to Cauchy's functional equation (for all $x, y$). But since $f$ is measurable, $\phi$ and $\phi_0$ must be measurable, and thus $\phi_0$ must be linear. From here it follows that $f, g, h$ are linear (or rather affine) almost everywhere.
