One can write $a=(\lambda b + c) + \bar{a}$ where $\lambda \in \mathbb{R}$, $c\in span(c^1,\ldots,c^m)$, and $\bar{a} \in \{b,c^1,\ldots,c^m\}^\perp$.
Also, One can write $b=d+\bar{b}$ where $d\in span(c^1,\ldots,c^m)$, and $\bar{b} \in \{c^1,\ldots,c^m\}^\perp$ (Note that if $\bar{b}=0$ then $S=\emptyset$, thus we can suppose that $\bar{b} \neq 0$).
Now, for each $x\in S$ we have $$f(x)=\lambda + \frac{\langle \bar{a},x \rangle }{\langle \bar{b},x \rangle}. $$
If $\bar{a}=0$ (i.e. $a \in span\{b,c^1,\ldots,c^m\}$), then $f$ is a constant function on $S$. therefore, $f$ is bounded.
Otherwise, If $\bar{a}\neq 0$, then for all $t \in \mathbb{R}$ set $x^t=\bar{a} + t \bar{b}$. For sufficiently small values of $t \in \mathbb{R}$ We have $x^t\in S$, and $$f(x^t)=\lambda + \frac{\langle \bar{a},\bar{a} \rangle }{t\langle \bar{b},\bar{b} \rangle}, $$ So, $|f(x^t)|\to \infty $ as $t\to \infty$$t\to 0$. Therefore f is not bounded.