<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_problematic_samples(file_name):
 """Reads a file with sample IDs. :param file_name: the name of the file containing problematic samples after sex check. :type file_name: str :returns: a set of problematic samples (tuple containing the family ID as first element and the sample ID as last element). Reads a file containing problematic samples after sex check. The file is provided by the module :py:mod:`pyGenClean.SexCheck.sex_check`. This file contains two columns, the first one being the family ID and the second one, the sample ID. """

    problematic_samples = set()
    open_func = open
    if file_name.endswith(".gz"):
        open_func = gzip.open
    with open_func(file_name, 'rb') as input_file:
        problematic_samples = set([
            tuple(i.rstrip("\r\n").split("\t")) for i in input_file.readlines()
        ])

    return problematic_samples