Before you read this answer, fetch a piece of paper and draw the following three points on it: $(0,0)$, $(x_{1},0)$ and $(x_{1},x_{2})$. These are the corners of a right-angled triangle whose hypotenuse I'd like to call $\gamma$ whose side on the $x_1$-axis I call $\gamma_{1}$ and whose parallel to the $x_2$-axis I call $\gamma_2$.
More formally, let $\gamma: [0,1] \to \mathbb{R}^2$ be the path $t \mapsto tx$. Similarly, let $\gamma_{1} : [0,1] \to \mathbb{R}^2$ be the path $t \mapsto (tx_{1},0)$ and $\gamma_{2} : [0,1] \to \mathbb{R}^2$ be the path $t \mapsto (x_{1}, tx_{2})$.
The integral on the left hand side can be written as $\int_{0}^{1} df(\gamma(t))\cdot\dot{\gamma}(t)\,dt = \int_{0}^{1} \frac{d}{dt}(f \circ \gamma)(t)\,dt = f(\gamma(1)) - f(\gamma(0)) = f(x_1, x_2) - f(0,0).$
Similarly, after some simple manipulations the right hand side is equal to $\int_{0}^{1} \frac{d}{dt} (f \circ \gamma_{1})(t)\,dt + \int_{0}^{1} \frac{d}{dt} (f \circ \gamma_2)(t)\,dt = \left( f(\gamma_{1}(1)) - f(\gamma_{1}(0))\right) + \left(f(\gamma_2 (1)) - f(\gamma_2(0))\right)$ and as $\gamma_1 (1) = (x_1,0) = \gamma_2 (0)$ two terms cancel out and what remains is $f(x_{1},x_{2}) - f(0,0)$.
Thus the left hand side and the right hand side are equal.