This question isn't about the actual substance of math so much as it is about style. I'm not going to school, so my feedback on these sorts of problems is limited. How would you improve this proof's readability? And if this isn't the sort of question that's suitable here, where would be a more appropriate venue? The problem is pretty straightforward (from little Spivak):
If $f:\mathbb{R}^2\rightarrow \mathbb{R}$ and $D_2f=0$, show that $f$ is independent of the second variable. If $D_1f=D_2f=0$, show that $f$ is constant.
The definition of "independent of the second variable" that we are using is:
A function $f:\mathbb{R}^2 \rightarrow \mathbb{R}$ is independent of the second variable if for each $x\in \mathbb{R}$ we have $f(x,y_1)=f(x,y_2)$ for all $y_1,y_2\in\mathbb{R}$.
My solution as I have written it is:
Assume $f:\mathbb{R}^2\rightarrow \mathbb{R}$ and $D_2f=0$. Let $x$ be arbitrary. By integration, $\int f_2(x,y)=\int 0=C$ for some constant $C$. It follows that $f(x,y_1)=f(x,y_2)=C$ for all $y_1,y_2\in\mathbb{R}$. Since $x$ was arbitrary, it follows from the definition that $f$ is independent of the second variable.
To show that $f$ is constant when $D_1f=D_2f=0$ we proceed by contradiction. Assume that $f$ is not constant. Then there exists some $x_1,y_1,x_2,y_2$ such that $f(x_1,y_1) \ne f(x_2,y_2)$. Since $f$ is independent of the second variable, it follows that $f(x_1,y_1)=f(x_1,y_2)$ and $f(x_1,y_2) \ne f(x_2,y_2)$. By the mean value theorem there exists $x\in(x_1,x_2)$ such that
$$Df_1(x,y_2)=\displaystyle\frac{f(x_2,y_2)-f(x_1,y_2)}{x_2-x_1} \ne 0$$
which is the desired contradiction.