A compressor with cooling function, comprising: a compressing device to be rotationally driven by a drive unit; and a cooling device configured to cool compressed air ejected from the compressing device, wherein the cooling device comprises: a case having a cooling area inside; an inlet provided in an upper surface of the case, the inlet allowing compressed air ejected from the compressing device to flow in; an outlet provided in the upper surface of the case, the outlet allowing the compressed air to be discharged outside; a cooling device housed in the cooling area and configured to cool the compressed air; a partitioning wall partitioning a space around the cooling device in the cooling area into an inlet-side cooling area having the inlet and an outlet-side cooling area having the outlet; and a drain space configured to store condensed water produced from the compressed air cooled when passing through the cooling device, the outlet-side cooling area has an inner wall surface formed of an arc-like curved surface, the inner wall surface includes a first inner wall surface and a second inner wall surface defined by a boundary line being offset toward the inlet and the outlet from a center lace of the cooling device extending in a direction perpendicular to the partitioning wall, the first inner wall surface being an inner wall surface located on the same side as the inlet and the outlet, the second inner wall surface being an inner wall surface located on the same side as the drain space, and the first inner wall surface and the second inner wall surface have different curvatures, the drain space is formed under the cooling device in the inlet-side cooling area and the outlet-side cooling area, characterized in that a lower surface of the inlet-side cooling area is provided with a flow-smoother protrusion at a position facing a lower edge portion of the cooling device, the flow-smoother protrusion protruding to have a tip thereof located close to the lower edge portion of the cooling device. a case having a cooling area inside; an inlet provided in an upper surface of the case, the inlet allowing compressed air ejected from the compressing device to flow in; an outlet provided in the upper surface of the case, the outlet allowing the compressed air to be discharged outside; a cooling device housed in the cooling area and configured to cool the compressed air; a partitioning wall partitioning a space around the cooling device in the cooling area into an inlet-side cooling area having the inlet and an outlet-side cooling area having the outlet; and a drain space configured to store condensed water produced from the compressed air cooled when passing through the cooling device, the outlet-side cooling area has an inner wall surface formed of an arc-like curved surface, the inner wall surface includes a first inner wall surface and a second inner wall surface defined by a boundary line being offset toward the inlet and the outlet from a center lace of the cooling device extending in a direction perpendicular to the partitioning wall, the first inner wall surface being an inner wall surface located on the same side as the inlet and the outlet, the second inner wall surface being an inner wall surface located on the same side as the drain space, and the first inner wall surface and the second inner wall surface have different curvatures, the drain space is formed under the cooling device in the inlet-side cooling area and the outlet-side cooling area, characterized in that a lower surface of the inlet-side cooling area is provided with a flow-smoother protrusion at a position facing a lower edge portion of the cooling device, the flow-smoother protrusion protruding to have a tip thereof located close to the lower edge portion of the cooling device.