Let $f:S \rightarrow \mathbb{R}$ be defined as
$$f(x) = \begin{cases} g(x) & \text{if}\ x \in D, \\ h(x) & \text{if}\ x \in S/D, \end{cases} $$
where $S \subset \mathbb{R}$ and $D \subset S$ is a dense subset of $S$. Are there any theorems regarding properties of $g,h$ and $f$'s continuity or discontinuity?
If $f$ is continuous then $f|_D$ and $f|_{S\setminus D}$ i.e. $g$ and $h$ are continuous having $D$ and $S\setminus D$ endowed with subspace topologies. But the converse does not hold (take the characteristic function of $\mathbb{Q}$).
If $f, g:X\to\mathbb{R}$ are continuous then $f=g$ as restrictions of $f$ and $g$ to the dense subset $D$ are identical. (Exercise: Let $f, g:X\to\mathbb{R}$ be two continuous functions. Show that if $f|_D=g|_D$ then $f=g$. (Hint: $\{x:x\in X\ \text{and}\ f(x)=g(x)\}$ is closed.)) Moreover you can deduce that if $\mathcal{F}$ is the set of all continuous functions $f:X\to\mathbb{R}$ then $|\mathcal{F}|\leq \mathbb{|R|}^{|D|}$.