Equality of functions on real numbers implies equality on rationals?

Define a pair of functions $p, h: \mathbb{Q} \to [0,1]$ over the rational numbers, with the properties

\begin{align} 0 \le p(x) \le 1 && 0 \le h(x) \le 1 && (x\in\mathbb{Q}), \\ \end{align}

as well as

\begin{align} \sum_{x\in\mathbb{Q}}p(x)=1 && \sum_{x\in\mathbb{Q}}h(x)=1. \end{align}

Now define the functions $p', h':\mathbb{R} \to [0,1]$ according to the rules:

\begin{align} p'(y) := \sum_{x<y}p(x),\\ h'(y) := \sum_{x<y}h(x),\\ \end{align}

where the sum is taken over the rationals $x \in \mathbb{Q}$.

Suppose it is known that $p'(y) = h'(y)$ for all $y \in \mathbb{R}$. Is this knowledge sufficient to conclude that $p(x) = h(x)$ for all $x \in \mathbb{Q}$?

• I assume there is some typo in the definitions of $p',h'$. – Ian Aug 24 '18 at 18:40
• @Ian I've fixed the typo, thanks! – jII Aug 24 '18 at 19:11

Assume $p'=h'$. Let $a$ be a rational number and suppose $p(a)>h(a)$. Then there is some $b>a$ such that $\sum_{y\in\Bbb Q:a<y<b}h(y)<p(a)-h(a)$. Then $$h'(b)=h'(a)+h(a)+\sum_{y\in\Bbb Q:a<y<b}h(y)<p'(a)+p(a)<p'(b)$$ a contradiction.
• To the proposer: Part of the hypotheses can be weakened to $p,h :\Bbb Q\to [0,\infty)$ such that $\sum_{x\in \Bbb Q}p(x)<\infty >\sum_{x\in \Bbb Q}h(x).$ – DanielWainfleet Aug 24 '18 at 19:10