TITLE: Can the chain rule be relaxed to allow one of the functions to not be defined on an open set?
QUESTION [23 upvotes]: I've written the question first, then the motivation behind it and lastly some background. Note that the question makes references to definitions and theorems written in the background bit at the end. The short description of why I'm asking this question is in there in case anyone is interested/has something to say about it (e.g., that I'm going wrong somewhere).
Thank you very much in advanced.

Is it possible to modify Theorem 3 such that the premise reads
"Suppose $E$ is an open set in $\mathbb{R}^n$, $f$ maps $E$ into $\mathbb{R}^m$, $f$ is differentiable at $x\in E$, $g$ maps (1) containing $f(E)$ into $\mathbb{R}^k$, and $g$ is (2) at $f(x)$"
and the conclusion reads 
"$F(x)=g(f(x))$ is differentiable at $x$ and $F'(x)=(3)f'(x).$"
where 

(1) = the non-negative orthant of $\mathbb{R}^n$, that is $\{x\in\mathbb{R}^n:x_i\geq 0,\quad i=1,2,\dots,n\}$ (or some type of set that encompasses the non-negative orthant, for example, closed, convex, etc.).
(2) = some criterion analogous to differentiable but that can be defined functions that are not defined on open subsets of $\mathbb{R}^n$ (see Definition 1).
(3) = some function evaluated at $f(x)$ analogous to the derivative $g'$ (see Definition 1) of $g$ evaluated at the point $f(x)$.

If so,

What are (1), (2), and (3)? 
Does there exists some theorems analogous to Theorem 1 and 2 that provide us with an easy way to test for (2) and compute (3)?
Otherwise how does one check for (2) and computes (3)?
Alternatively, if there is a reason one cannot do the above, what is it?


Motivation
I'm looking at initial value problems of the type
$$\dot{x}=f(x),\quad\quad x(0)=x_0$$
where $x_0$ is in the non-negative orthant of $\mathbb{R}^n$, $\{x\in\mathbb{R}^n:x_i\geq 0,\quad i=1,2,\dots,n\}$ and $f$ maps from the non-negative orthant to $\mathbb{R}^n$. I'm looking at the above because I'm would like to be able to evaluate the time derivative of a Lyapunov function $V$ which is only defined on the non-negative orthant much in the same fashion one usually does, by using the chain rule:
$$\dot{V}(x(t))=\frac{\partial V}{\partial x}(x(t))\dot{x}(t).$$

Background
If $x\in\mathbb{R}^n$, let $|x|$ denote the euclidean norm on $\mathbb{R}^n$ evaluated at $x$. 
Definition 1 (Differentiable): Suppose $E$ is an open set in $\mathbb{R}^n$, $f$ is a function that maps $E$ into $\mathbb{R}^m$, and $x\in E$. If there exists a linear transformation $A$ from $\mathbb{R}^n$ to $\mathbb{R}^m$ such that
$$\lim_{h\rightarrow 0}\frac{|f(x+h)-f(x)-Ah|}{|h|}=0$$
then we say that $f$ is differentiable at $x$, and we write
$$f'(x)=A.$$
If $f$ is differentiable at every $x\in E$ we say that $f$ is differentiable in $E$.
In the above, it was implicitly assumed that $h\in\mathbb{R}^n$. Since $E$ is open, if $|h|$ is small enough then $x+h\in E$, thus the above limit makes sense.

If we know a priori that $f$ is differentiable at a point $x$, then we can use the following handy theorem to find $f'(x)$.
Theorem 1: Suppose $f$ maps an open set $E\subset\mathbb{R}^n$ into $\mathbb{R}^m$ and $f$ is differentiable at a point $x\in E$. Then the partial derivatives 
$$\frac{\partial f_i}{\partial x_j}(x) := \lim_{t\rightarrow0}\frac{f_i(x+te_j)-f_i(x)}{t},$$
where $e_j$ denotes the $j^{th}$ vector of the standard basis of $\mathbb{R}^n$, exist. Furthermore, using the standard bases of $\mathbb{R}^n$ and $\mathbb{R}^m$,
$$f'(x)=\left[\frac{\partial f}{\partial x}(x)\right],$$
where the RHS denotes the matrix whose $i,j$ entry is given by the partial derivative defined above.

However, to be able to use the above we first need to be able to conclude that $f$ is differentiable. If $f$ is continuously differentiable we can also use the partial derivatives to this end.
Definition 2 (Continuously differentiable): We say that a differentiable function $f$ that maps from an open subset $E\subset \mathbb{R}^n$ into $\mathbb{R}^m$ is continuously differentiable if $f'$ is a continuous mapping of $E$ into the set of linear functions that map from $\mathbb{R}^n$ to $\mathbb{R}^m$, $L(\mathbb{R}^n,\mathbb{R}^m)$ (for example, defining continuity using some induced matrix norm to define a metric on $L(\mathbb{R}^n,\mathbb{R}^m))$. 
Theorem 2: Suppose that $f$ maps an open set $E\subset \mathbb{R}^n$ into $\mathbb{R}^m$. If $f$ is continuously differentiable if and only if all the partial derivatives of $f$ exist and are on continuous on $E$.

One final result, the chain rule:
Theorem 3: Suppose $E$ is an open set in $\mathbb{R}^n$, $f$ maps $E$ into $\mathbb{R}^m$, $f$ is differentiable at $x\in E$, $g$ maps an open set containing $f(E)$ into $\mathbb{R}^k$, and $g$ is differentiable at $f(x)$. Then the mapping of $E$ into $\mathbb{R}^k$ defined by 
$$F(x)=g(f(x))$$
is differentiable at $x$ and
$$F'(x)=g'(f(x))f'(x).$$

REPLY [2 votes]: You can extend the definition of differentiability as follows
Definition. Let $D$ be any subset of $\mathbb R^n$, let $x_0\in D$. Let $g\colon D\to \mathbb R^m$. Let $L\colon \mathbb R^n\to \mathbb R^m$ be a linear map. We say that $g$ has differential $L$ at $x_0$ if
$$
\lim_{x\to x_0,\ x\in D} \frac{f(x)-f(x_0) - L(x-x_0)}{|x-x_0|} = 0.
$$
We say that $g$ is differentiable at $x_0$ if there exists at least one linear $L$ such that $g$ has differential $L$ at $x_0$.
Notice that if $x_0$ is not an internal point, the differential might not be unique.
Then I would guess that the following is true:
Theorem. Let $\Omega\subset \mathbb R^n$ open, $x_0\in \Omega$, $f\colon \Omega\to \mathbb R^m$ differentiable at $x_0$, $g\colon f(\Omega)\to \mathbb R^k$ differentiable at $f(x_0)$. Then $g\circ f\colon \Omega \to \mathbb R^k$ is differentiable at $x_0$.
Notice that the hypothesis on $g$ is weaker than the usual chain rule theorem, but the thesis is the same.