A differentiable function intersecting every vertical plane $y = \lambda x$ must be linear This question is from a midterm that I just took and wasn't able to solve. If someone could provide a sketch for a solution that would be really helpful, also currently I'm studying analysis by Munkres, could someone suggest books that would help me be better prepared for the next midterm. 
Let $f:\mathbb{R}^2 \rightarrow \mathbb{R}$, such that f(x,y) = z is differentiable and intersects every vertical plane $y = \lambda x$ in a straight line. 
Show that f is a linear function $f = ax + by + c$. Can the differentiabilty condition be reduced to just continuity? 
Thank you 
 A: By assumption, there exists a function $\varphi\colon\mathbb{R}\to\mathbb{R}$ such that
$$
f(x, \lambda x) = f(0,0) + \varphi(\lambda) x,
\qquad
\forall \lambda, x.
$$
On the other hand, $f$ is differentiable at $(0,0)$, hence there exist $p,q\in\mathbb{R}$ such that
$$
\lim_{(x,y)\to (0,0)} \frac{f(x,y) - f(0,0) - px - qy}{\sqrt{x^2+y^2}} = 0.
$$
In particular, for every $\lambda\in\mathbb{R}$ we have that
$$
\lim_{x\to 0} \frac{f(x,\lambda x) - f(0,0) - px - q\lambda y}{|x| \sqrt{1+\lambda^2}} = 0,
$$
so that
$$
\lim_{x\to 0}\frac{x}{|x|} [\varphi(\lambda) - p - \lambda q] = 0.
$$
This relation implies that
$$
\varphi(\lambda) = p + \lambda q,
$$
i.e.
$$
f(x, \lambda x) = f(0,0) +  p x + q \lambda x,
\qquad
\forall \lambda, x.
$$
In particular, given $(x,y)$ with $x\neq 0$ and choosing $\lambda = y/x$ one gets
$$
f(x,y) = f(0, 0) + p x + q y,
\qquad \forall x\neq 0.
$$
Finally, by continuity the relation holds for every $x,y$.
Continuity of $f$ (instead of differentiability) is not enough to get the conclusion.
Namely, the function
$$
f(x,y) = \begin{cases}
\frac{x^3}{x^2+y^2}, & (x,y)\neq (0,0),\\
0, & (x,y) = (0,0),
\end{cases}
$$
is continuous and satisfies 
$$
f(x, \lambda x) = \varphi(\lambda) x,
\qquad
\varphi(\lambda) = \frac{1}{1+\lambda^2}\,.
$$
On the other hand, it is not a linear function.
