[Solution 1]Let n=2r and define
A1=A2=A3={1,2,⋯,2r−1},{1,2,⋯,2r−2,2r−1+1,2r−1+2,⋯,2r−1+2r−2},{1,2,⋯,2r−3,2r−2+1,2r−2+2,⋯,2r−2+2r−3,2r−1+1,2r−1+2,⋯,2r−1+2r−3,2r−1+2r−2+1,2r−1+2r−2+2,⋯,2r−1+2r−2+2r−3},
⋮Ar−1={1,2,5,6,9,10,⋯,2t−3,2t−2},Ar={1,3,5,7,⋯,2t−3,2t−1}.
It is easy to see that F={A1,A2,⋯,Ar} distinguishes S and Ui=1rAi={1,2,⋯,2r−1}={1, 2,⋯,n−1}. Clearly, adding just one more set A0={n} to F will cover S. Therefore, we have
f(n)⩽r+1=[log2n]+1.
When 2r−1+1⩽n⩽2r−1, F itself (possibly intersected with S) is both distinguishing and covering S, so (1) still holds.
On the other hand, we use mathematical induction to prove the reverse inequality of (1):
f(n)⩾r+1, when 2r⩽n⩽2r+1−1
By f(2)=f(3)=2, we know that (2) holds for r=1. Assume (2) holds for r=k. When r= k+1, let F={A0,A1,⋯,At} be both distinguishing and covering S. Let A′0=S−A0, then ∣A0∣+∣A′0∣=n, without loss of generality, assume ∣A0∣⩾[2n]. At this time, {A1∩A0,A2∩ A0,⋯,At∩A0} is both distinguishing and covering A0. Therefore, by the induction hypothesis, t⩾ f([2n])⩾k+1. Thus, (2) also holds for r=k+1.
In summary, f(n)=[log2n]+1.
[Solution 2] Let F={A1,A2,⋯,At} be both distinguishing and covering S. Consider the relation table of the subsets Ai of S and the elements
where
xij={1, when i∈Aj,0, when i∈/Aj,i=1,2,⋯,n,j=1,2,⋯,t.
Since F is covering, each element i belongs to at least one Aj, i.e., each row in the table is not all 0; since F is distinguishing, no two rows in the table are identical. Since there are 2t−1 different non-zero vectors of t components, each of which is 0 or 1, we have
n⩽2t−1.
Thus, we get
f(n)⩾[log2n]+1.
On the other hand, for n∈N, take t∈N such that 2t−1⩽n⩽2t−1 and take n different non-zero t-vectors:
(xi1,xi2,⋯,xit),i=1,2,⋯,n,
where xij are all 0 or 1. Define the subset Aj⊂S as follows: for each i∈S, i∈Aj if and only if xij=1, j=1,2,⋯,t. It is easy to verify that F={A1,A2,⋯,At} is both distinguishing and covering S={1,2,⋯,n}. Therefore, we get
f(n)⩽t=[log2n]+1.
From (3) and (4), we have f(n)=[log2n]+1.