def check_number(x, lower=None, upper=None):
    """
    This function returns True if the first argument is a number and it lies between the next two arguments.
    Othwerise, returns False.

    :param x: Value to be checked
    :type x: number
    :param lower: minimum value accepted
    :type lower: number
    :param upper: maximum value accepted
    :type upper: number
    :return: if 'x' check pass
    :rtype: bool

    """

    if x is None:
        return False
    lower = lower if lower is not None else float("-inf")
    upper = upper if upper is not None else float("inf")
    is_number = isinstance(x, float) or isinstance(x, int)
    return is_number and (x >= lower and x <= upper)