How can you deduce from the structure that probenecid is an acid and ephedrine is a base?
The nitrogen atom in Probenecid is not part of a basic functional group (eg: amine), but of another kind of functional group: sulfonamide.

Sulfonamides are, just like amides, quite acidic: the presence of an electron-withdrawing group next to the nitrogen atom makes the electron pair less available, and makes the functional group quite acidic (see Lewis' definition of acids and bases).

For comparison, ammonium has a pKa of around 9, amides have a pKa above 15.

Sharing with amides the presence of an electron withdrawing group, sulfonamides can be expected to share the same acidic behaviour of amides.

You should check pKa list for the functional groups you have studied.

An example of such chart: 

http://evans.rc.fas.harvard.edu/pdf/evans_pKa_table.pdf
(Be careful: values between parentheses are referred to the acidity in DMSO).

To better understand the delocalization of the electron pair in amides, see:
https://chem.libretexts.org/Bookshelves/Organic_Chemistry/Supplemental_Modules_(Organic_Chemistry)/Amides/Properties_of_Amides/Structure_of_Amides