Solution by anakinwang.
Define the equivalence relation ∼ on R such that a∼b for a,b∈R iff a=4nb for some n∈Z, and write [a] to be the equivalence class of any a∈R. Let X=R/∼, and call a set S of unordered pairs {a,b} mounkish if it is a partition of the elements of X∖{[0]} into pairs, where each [a]∈X is replaced with a representative element a∈[a]. In other words, a mounkish S is defined by any free involution on X, along with a choice of representative elements.
We claim that a function f:R→R satisfies f(2f(x))=2x (call this property P) for all x∈R iff f(0)=0 and there exists a mounkish set S such that for any n∈Z and {a,b}∈S, there is some m∈Z such that f(4na)=22n+2m−1b and f(4nb)=22n−2m+1a.
Proof. To begin, observe that f is trivially injective: if f(a)=f(b) for a,b∈R, then f(2f(a))=2a=2b. We also observe f(4r)=f(2f(2f(r)))=4f(r) for any r∈R (call this property Q); this implies f(0)=0.
Fix some mounkish S. To show that the claimed solution defined by S satisfies P and is consistent, first observe that f(2f(0))=0=2f(0). In addition, given any n∈Z and {a,b}∈S, we know f(4na)=22n+2m−1b and f(4nb)=22n−2m+1a for some fixed m∈Z, so f(2f(4na))=f(22n+2mb)=2⋅4na for any n∈Z and a∈R. Hence, f is valid. Meanwhile, notice that any sequence of applications of P (and by extension Q) on the initial pair {a,b} may only generate equations in which f takes arguments in [a]∪[b], so f is also consistent for any S.
It remains to show that the claimed conditions are necessary; recall we already showed f(0)=0. First, we claim that for all r∈R∖{0}, we have f(r)=22k−1r for any k∈Z. FTSOC, suppose otherwise. Then f(22kr)=2r, but f(22kr)=22kf(r)=24k−1r, so k=21.
As such, let us define the function g:X→X satisfying g([r])=[s] iff f(r)∈[s] for [r],[s]∈X∖{[0]}. Let us quickly verify g is well-defined. If f(r)=s for r,s∈R, by Q we have f(4nr)=4ns for any n∈Z, so indeed {f(x):x∈[r]}=[s]. Suppose g([r])=[s] for some [r],[s]∈X. By our work on f, we know g([r])=[2r]. Let us write r=a and s=2b. Then g([a])=[2b], from which it follows that g([b])=[2a]. The map [a]↦[b] is hence a free involution on X. As such, we construct our mounkish S to be precisely the set of pairs {a,b} such that g([a])=[2b] and g([b])=[2a]; it is clear each element of X has exactly one representative found among these pairs.
Translating back to f, for each {a,b}∈S, we have g([a])=[2b], so f(a)=22m−1b for some m∈Z. It follows that f(22mb)=2a, so f(b)=2−2m+1a. By Q, we readily obtain f(4na)=22n+2m−1b and f(4nb)=22n−2m+1a, as desired. We conclude f must be of the form we described.