As you suggest, let me consider the case $f \equiv 1$. Without loss of generality, assume also that $a = 0$ and $b = 1$. Let $\sigma := o(1)/o(0) \in (0,1)$. The problem becomes
$$
\sup_{v \in C^1([0,1])} \int_0^1 v(x) \mathrm{d}x
\quad \text{s.t.} \quad
v(0)\leq \sigma v(1) \quad \text{and} \quad \sigma \leq v(x) \leq 1.
$$
First, note that I changed the maximum to a supremum, since it is not clear *a priori* that the supremum will be achieved (it will turn out not to be the case). Second, note that the function $o(x)$ has disappeared from the problem, only remaining through the single real value $\sigma \in (0,1)$.

Since $v(x) \leq 1$ on $[0,1]$, one has $\int_0^1 v \leq 1$ for any admissible $v \in C^1([0,1])$. Let us check that $1$ is the value of the supremum, but that it is not achieved.
- If $v \in C^1([0,1])$ is such that $v(x) \leq 1$ on $[0,1]$ and $\int_0^1 v = 1$, then $v \equiv 1$. But the constraint $v(0) \leq \sigma v(1)$ becomes $1 \leq \sigma$, which fails because $\sigma \in (0,1)$. So the supremum cannot be achieved.
- For $n \in \mathbb{N}^*$, let $v_n(x) := 1$ for $x \in [1/n,1]$ and $v_n(x) := 1 + (\sigma-1)n^2(x-1/n)^2$ for $x \in [0,1/n]$. Then $v_n \in C^1([0,1])$ because the junction at $x=1/n$ is $C^1$, $\sigma \leq v_n \leq 1$ on $[0,1]$, and $\sigma = v(0) \leq \sigma v(1) = \sigma$ because $v(1) = 1$. Moreover, one checks that $\int_0^1 v_n \geq 1 - 1/n$. So the supremum is indeed equal to $1$.