Here is a positive result that's pretty obvious but still worth mentioning since you're just supposing that $S$ is a set: if $S=\Omega$ is the power object of a singleton, i.e., the set of truth values, i.e., the subobject classifier (working in the internal logic of a topos, or in $\mathsf{IZF}$), then every function $[a,b]\cup[b,c] \to \Omega$ can be extended to a function $[a,c] \to \Omega$, because this just means that every subset of $[a,b]\cup[b,c]$ is the restriction of a subset of $[a,c]$, and that's certainly the case, namely, of itself. Moreover, since this extension is canonical, it follows that the extension result also holds when $S = \Omega^I$ is the power object of an arbitrary set $I$.
↧