Let $ G \subset \mathbb{R}^n $ be a convex set, $ f : G \to \mathbb{R}^n $ continuously differentiable and $$ \text{det} \begin{pmatrix} \partial_1 f_1 (c_1) & \cdots & \partial_n f_1 (c_1) \\ \vdots & & \vdots \\ \partial_1 f_n (c_n) & \cdots & \partial_n f_n (c_n) \\ \end{pmatrix} \not= 0$$ for all $ c_1, \dots, c_n \in G $.
I'm supposed to prove that this function is injective. I thought of using the mean value theorem: Assume that f is not injective. Then there are $a, b \in G $ with $ f(a) = f(b) $ and $ a \not= b $. The mean value theorem would give me a $ c_i $ for each $ i \in \{1, \dots, n\} $ such that $ f_i(b) = f_i(a) + f_i'(c_i) \cdot (b-a) $, and since $ f_i(b) = f_i(a) $ and $ b - a \not= 0 $ it would follow that $ f_i'(c_i) = 0 $ for all $ i \in \{1, \dots, n \} $. From that it would follow that all the partial derivatives are zero, so the determinant above would also be zero.
However, it seems like I can't use the mean value theorem because $G$ is not open, which is a requirement for the theorem. Does that make my attempt completely wrong, or would it work with some adjustments?