I have the function $\cos(x)\lfloor x \rfloor$ which I would like to make continuous without changing the derivative where it exists or the values approaching 0 from the right side. I can do this by subtracting a piecewise constant function from it. My trouble here is that I do not know what that function should be.
I believe it is:
$$\sum^{\lfloor x \rfloor}_{i=0} \cos(x)$$
But I am unsure as to how would I would reduce it further or if it is correct. Help would be appreciated, thank you.
Your idea ist almost correct, namely to substract the jumps from the function. Obviously, $f:[0,\infty)\to\mathbb R,\ x\mapsto\cos(x)[x]$ has jumps only at $x=x_0\in\mathbb N$, and at each those points we have \begin{align*} \lim_{x\to x_0-}f(x)=\cos(x_0)(x_0-1),\qquad \lim_{x\to x_0+}=\cos(x_0)x_0. \end{align*} Thus, the hight of each jump is $\cos(x_0)$, so \begin{align*} F(x):=\cos(x)[x]-\sum_{k=1}^{[x]}\cos(k) \end{align*} is continuous on $[0,\infty)$.
To make it continuous in all of $\mathbb R$, you can do the same trick for negative values of $x$. Thus, \begin{align*} F(x):=\cos(x)[x]-\sum_{k=1}^{[x]}\cos(k)+\sum_{k=0}^{[-x]}\cos(k) \end{align*} is continuous in $\mathbb R$. Here, a sum $\sum_{k=a}^b...$ is meant to be 0, if $b<a$.