As a simple example, suppose we have a function $f: \mathbb{R}^3 \to \mathbb{R}$ defined on the set (and taking $+\infty$ everywhere else), $$\{x \in \mathbb{R}^3| x_1 \in [-1, 1], x_2 \in [-1, 1], x_3 = 0\}$$ The set has no interior but a relative interior given by $(-1,1) \times (-1,1) \times \{0\}$. Similarly, consider sets such as $\{x \in \mathbb{R}^3| \langle e, x\rangle = 1, x_i \geq 0\}$, where $e$ is the one-vector. Once again, it has no interior, but has a relative interior relative to the hyperplane $\langle e, x \rangle = 1$ given by $\{x \in \mathbb{R}^3| \langle e, x\rangle = 1, x_i > 0\}$, Is such function differentiable on such sets (i.e. the gradient exists)? If not, why? Can't seem to find any resource on this.