Suppose that the set A is more than countable set.
Divide half-plane R×(0,+∞) to the counted number of rectangles:
Dn,m=[n,n+1)×[m+11,m1), n∈Z, m∈N, Dn,0=[n,n+1)×[1,+∞).
By construction, ⋃n∈Z⋃m∈Z+Dn,m=R×(0,+∞), in addition, any two of determined earlier rectangles do not intersect. Consider the graph G={(x,f(x))∣x∈A} of the function f.
Because A is more than countable, the set G is also more than countable (A∼G).
Suppose that ∀n∈Z,m∈Z+ (i.e. the set G∩Dn,m) is finite, but then the whole set G is at most countable, that contradicts its construction. Therefore, ∃n0∈Z,m0∈Z+:G∩Dn0,m0 is infinite set. This means that there is an infinite set X⊂[n0,n0+1)∩A such that ∀x∈X f(x)>m0+11. Then due to Bolzano-Weierstrass theorem there is a sequence of different elements that converges to some number. As a result, this sequence is fundamental and ∀k∈N f(xk)>m0+11. But then we have the following relationship: 0=limk→∞∣xk+1−xk∣ and min{f(xk),f(xk+1)}≥m0+11, which contradicts the problem's condition.
Thereby, A should be no more than countable. Now determine the required function. Let A={x1,x2,...}. Define the function by induction: f(x1)=1. Now let us know f(x1),...,f(xn). Let us make the following notation: r=mink=1,n∣xn+1−xk∣>0. Let's set f(xn+1)=2r.
We should verify that the function which is defined for A satisfies the conditions of the problem.
Example: for A=Q: if x=qp, where (p,q)=1, p∈Z, q∈N (0=10), we will set f(qp)=q21. Then if q1p1=q2p2 we have:
∣x1−x2∣=q1q2∣p1q2−q1p2∣≥q1q21≥max{q12,q22}1=min{f(x1),f(x2)}.