Proof or counter-example that $(0,t_0)$ is a maximum of $f: [0,1]^2 \to \mathbb{R}$ if $t_0$ is a maximum of $g(t) := f(0,t)$. Suppose $f: [0,1] \times [0,1] \to \mathbb{R}$ is a differentiable function. Define $g(t) = f(0,t)$ and suppose that $g$ has a maximum in $t_0 \in (0,1)$, and suppose additionally that $D_1f(0,t_0) < 0$. I need to either prove, or give a counter-example to the fact that then $(0,t_0)$ is a local maximum of $f$. 
Firstly it follows that $g'(t_0) = D_2f(0,t_0) = 0$. I have set up the Taylor expansion, write $\vec{a} = (0,t_0)$, then: 
$$
f(\vec{a} + \vec{h}) = f(\vec{a}) + D_1f(\vec{a})h_1 + D_2(\vec{a})h_2 + o(\|\vec{h}\|) = f(\vec{a}) + D_1f(\vec{a})h_1 + o(\|\vec{h}\|). 
$$
Now if $h_1 < 0$ it seems that $f(\vec{a} + \vec{h}) > f(\vec{a})$, or at least has the potential to be greater, so my guess is that it does not hold and we need to specify a counter-example. I have tried several but everything fails. 

This example is built around a standard example of a function for which both partials exist at a point, yet the function behaves badly near the point. That will be called $q(x,y),$ and is $(xy)/(x^2+y^2)$ except at the origin where it is defined as $0.$ One can then show both partials of $q$ are $0$ at the origin.
For ease of discussion we redefine the domain to be $[-1,1] \times [0,1]$ and will take $t_0=0$ noting that this is in the open interval $(-1,1).$ 
Now define $f(x,y)=q(x,y)-x-y^2.$ We have $D_1(0,0)=-1<0$ as required. Also $g(t)=f(0,t)=-t^2$ which has its maximum at $0 \in (-1,1)$ where it is $0.$
Now $f$ fails to have a local maximum at the origin, since (for $t \neq 0$) $f(t,t)=1/2-t-t^2,$ which tends to $+1/2$ as $t \to 0.$
Edit: This example is not differentiable at the origin (the interior point of the left side of the altered domain).
