Surname Overview
Surname Status
The source explicitly classifies 函 as a currently extant rare surname, pronounced hán; it says it is now distributed in Yangquan, Shanxi, and records that it appears in Zheng Tongzhi's Clan and Lineage Gazetteer. The source does not state an ethnic affiliation.
Reference: 函姓_函姓的来源和历史_百家姓
Origins
Origin Traditions
The source gives several explanations: citing Guangyun through Xingshi Kaolue, it says the surname descended from Taiyue; citing Du Yu's commentary on Zuo Zhuan, it connects the surname with the Xu territory in the Spring and Autumn period and with a person giving a place its name; it also gives the theory that the surname came from hereditary office-holders who made armor as the Hanren in the Zhou offices. These remain claims reported by the cited works or surname compilations.
Reference: 函姓_函姓的来源和历史_百家姓
Historical Records
Readings and Attestations
The source also records xián as a rare surname reading found in Zheng Tongzhi's Clan and Lineage Gazetteer, citing Guangyun for the statement that the surname descended from Taiyue. The same source says that hán is the current surname reading and rejects the xiǎn reading given in Xingshi Cidian.
Reference: 函姓_函姓的来源和历史_百家姓