Let $P$ and $Q$ denote posets, and $f : P \rightarrow Q$ denote an arbitrary function.
Question. Does there necessarily exist a monotone function $g : P \times P^{\mathrm{op}} \rightarrow Q$ such that for all $p \in P$, we have $f(p) = g(p,p)$?
If not, is this at least true when $P$ is the real line?
In general this is not true. In fact, the answer is negative if $Q$ is not directed and the order of $P$ is not discrete.
For example, consider $P=\{0,1\}$ with $0 \leq 1$, $Q=\{0,1\}$ with the discrete order and the identity function. Then, in $P \times P^{\mathrm{op}}$, we have that $(0,0) \leq (1,0)$ and $(1,1) \leq (1,0)$. Therefore, $g(1,0)$ needs to be an upper bound of $\{0,1\}$ in $Q$.