If (subordinator)

If is a subordinator similar to whether, marking the subordinate clause as interrogative (e.g., I don't know if that works).

As a subordinator, if has no conditional meaning (for that, see if (preposition)). Instead, it introduces subordinate closed interrogative clauses. This aligns if with whether, and the two may often be used interchangeably, as in I doubt whether/if that's true. However, if is more constrained. As examples, it can appear neither in the whether or not construction (whether/*if or not the room is ready), nor for a clausal subject (Whether/*If to attend was the question).

Traditional grammar books commonly treat if, often understood as a single word encompassing both this subordinator and the homonymous preposition, as a "subordinating conjunction", a category covering a broad range of clause-connecting words.

History
The Oxford English Dictionary traces the word back to its Germanic roots, with cognates in several old Germanic languages, each broadly carrying the meaning of 'if' or 'whether'. The subordinator if (along with the conditional preposition if) existed in the earliest records of English. Examples of the subordinator follow:

Ðonne mæg mon geseon gif ðær hwelc dieglu scond inne bið.

Then may one see if there any secret shame in is

'Then one can see if there is any secret shame within.' King Ælfred, translation of Gregory, Pastoral Care (Hatton MS.) (1871) xxi. 157 (Early Old English, from the 890s)

He.. frægn gif him wære æfter neodlaðu[m]   niht getæse.

He asked if him was after urgent-journey night agreeable

'He asked if the night had passed to his liking after the urgent journey.' Beowulf 1319 (Old English, from between 975 and 1025)

The OED notes the existence of forms with an initial g, reflecting a palatal /j/.