Solution:
a.
Let the set A consist of the 4n integers 1,2,…,4n and let the set B consist of the 2n even integers 4n+2,4n+4,…,8n. We claim that the 6n-element set S=A∪B has the desired property.
Indeed, the least common multiple of two (even) elements of B is no larger than 8n⋅(8n/2)=32n2, and the least common multiple of some element of A and some element of A∪B is at most their product, which is at most 4n⋅8n=32n2.
b.
We prove the following lemma: "If a set U contains m+1 integers, where m⩾2, that are all not less than m, then some two of its elements have least common multiple strictly larger than m2."
Let the elements of U be u1>u2>⋯>um+1⩾m. Note that 1/u1⩽1/ui⩽1/m for 1⩽i⩽m+1. We partition the interval [1/u1;1/m] into m subintervals of equal length. By the pigeonhole principle, there exist indices i,j with 1⩽i<j⩽m+1 such that 1/ui and 1/uj belong to the same subinterval. Hence
0<uj1−ui1⩽m1(m1−u11)<m21.
Now 1/uj−1/ui is a positive fraction with denominator lcm(ui,uj). The above thus yields the lower bound lcm(ui,uj)>m2, completing the proof of the lemma.
Applying the lemma with m=3n to the 3n+1 largest elements of T, which are all not less than 3n, we arrive at the desired statement.
A Variant.
Alternatively, for part (b), we prove the following lemma: "If a set U contains m⩾2 integers that all are greater than m, then some two of its elements have least common multiple strictly larger than m2."
Let u1>u2>⋯>um be the elements of U. Since um>m=m2/m, there exists a smallest index k such that uk>m2/k. If k=1, then u1>m2, and the least common multiple of u1 and u2 is strictly larger than m2. So let us suppose k>1 from now on, so that we have uk>m2/k and uk−1⩽m2/(k−1). The greatest common divisor d of uk−1 and uk satisfies
d⩽uk−1−uk<k−1m2−km2=(k−1)km2
This implies m2/(dk)>k−1 and uk/d>k−1, and hence uk/d⩾k. But then the least common multiple of uk−1 and uk equals
duk−1uk⩾uk⋅duk>km2⋅k=m2
and the proof of the lemma is complete.
If we remove the 3n smallest elements from set T and apply the lemma with m=3n to the remaining elements, we arrive at the desired statement.