First suppose that \(f\) is differentiable at \(c\text{.}\) Define
\begin{equation*}
\varphi(x)=\begin{cases}
\dfrac{f(x)-f(c)}{x-c} & \text{if } x \neq c,\\
f'(c) & \text{if } x=c.
\end{cases}
\end{equation*}
Then \(f(x)-f(c)=\varphi(x)(x-c)\) for every \(x \in S\text{.}\) Also, for \(x \neq c\) the definition of derivative gives
\begin{equation*}
\varphi(x)=\frac{f(x)-f(c)}{x-c} \to f'(c)=\varphi(c)
\quad\text{as } x\to c,
\end{equation*}
so \(\varphi\) is continuous at \(c\text{.}\)
Conversely, suppose there exists \(\varphi \colon S \to \R\text{,}\) continuous at \(c\text{,}\) such that \(f(x)-f(c)=\varphi(x)(x-c)\) for every \(x \in S\text{.}\) Then for \(x \neq c\) we have
\begin{equation*}
\frac{f(x)-f(c)}{x-c}=\varphi(x).
\end{equation*}
Since \(\varphi\) is continuous at \(c\text{,}\) it follows that
\begin{equation*}
\lim_{x\to c}\frac{f(x)-f(c)}{x-c}
= \lim_{x\to c}\varphi(x)=\varphi(c).
\end{equation*}
Hence \(f\) is differentiable at \(c\) and \(f'(c)=\varphi(c)\text{.}\)