This is my definition for part 1 (in latex form)
\begin{alignat*}{2} \text{Base Case }& &&\text{ if } \mathtt{ones}(\varepsilon) = 0 \qquad \mbox{ ($ \varepsilon$ is the empty string)} \ \text{Inductive Step }& &&\text{ if } v \in \Sigma^{\ast} \text{ and } x \in \{1\} \text{ then } \mathtt{ones}(vx) = \mathtt{ones}(v) + 1\ & &&\text{ if } v \in \Sigma^{\ast} \text{ and } x \in \{0\} \text{ then } \mathtt{ones}(vx) = \mathtt{ones}(v) \end{alignat*}
For part 2, I was thinking of :

inducting on $ v$ by taking $ v=v^{\prime} x$

assuming true for $ \mathtt{ones}(w ++ v^{\prime}) = \mathtt{ones}(w) + \mathtt{ones}(v^{\prime})$

proceed to show that $ \mathtt{ones}\left(w ++ (v^{\prime}x)\right)$ holds for both $ x \in \{1\}$ and $ x \in \{0\}$ .
Like so,
For $ x \in 1$
\begin{align*} \mathtt{ones}(w ++ (v^{\prime}x)) &= \mathtt{ones}(w ++ v^{\prime})x) \quad \mbox{Concatenation}\ &= \mathtt{ones}(w ++ v^{\prime}) + 1 \quad \mbox{Definiton of } \mathtt{ones}\ &= \mathtt{ones}(w) + \mathtt{ones}(v^{\prime}) + 1 \quad \mbox{Induction Hypothesis}\ &= \mathtt{ones}(w) + \mathtt{ones}(v^{\prime}x) \ &= \mathtt{ones}(w) + \mathtt{ones}(v) \quad \mbox{ since } v=v^{\prime} x \end{align*}
For $ x \in 0$
\begin{align*} \mathtt{ones}(w ++ (v^{\prime}x)) &= \mathtt{ones}(w ++ v^{\prime})x) \quad \mbox{Concatenation}\ &= \mathtt{ones}(w ++ v^{\prime}) + 0 \quad \mbox{Definiton of } \mathtt{ones}\ &= \mathtt{ones}(w) + \mathtt{ones}(v^{\prime}) + 0 \quad \mbox{Induction Hypothesis}\ &= \mathtt{ones}(w) + \mathtt{ones}(v^{\prime}x) \ &= \mathtt{ones}(w) + \mathtt{ones}(v) \quad \mbox{ since } v=v^{\prime} x \end{align*}
I’m concerned about the following?

Is inducting on $ v$ the correct way to go about it? I chose it because it seems to be how concatenation is defined

I haven’t seen any definition with two branches in lectures. Is splitting the domain of $ x$ in 2 ok, given that I show that both cases follow? Is there a better and/or simpler alternative?