Let $U\subseteq \mathbb{R}$ be open and connected and $f,g : U \rightarrow \mathbb{R}$ differentiable functions such that $f'=g'$. Then we have by the fundamental theorem of calculus ( $f'-g'=0$ is continuous)
$$ (f-g)(x) - (f-g)(x_0) = \int_{x_0}^x (f-g)'(y)dy = 0$$
for some $x_0\in U $. More generally, we have everywhere differentiable function whose derivative is 0 almost everywhere is a constant. Which is telling us that functions that get identified under your equivalence relation are precisely those, which on every connected component differ by some constant.
For higher derivatives, say $n$ times differentiable, you can play the same game (just integrate some more times) and get that exactly those functions get identified which on every connected component differ by a polynomial of degree less or equal to $n-1$.
Please note that things turn into a nightmare if you assume less regularity, i.e. only take differentiablity a.e. for granted. There are functions that are differentiable a.e. and the derivative where it exists is equal to zero, however, the function is not constant (e.g. the Cantor function).