The answer seems to be that it has been there from the first international game
The site http://www.footballresearch.com/articles/frpage.cfm?topic=b-to1800
gives some early history of the game.
The "Cambridge Rules" of 1848 are described as follows:
"The original Cambridge code no longer survives, but a revised version from the
mid-1850's does. It describes a game very similar to modern soccer. Holding,
tripping, and pushing opposing players were all prohibited. A player could use
his hands only to stop the ball or to catch it and immediately kick it. The
goal consisted of two flagposts with a horizontal string stretched between
them. And, perhaps most important, a new offsides rule was established. In most
earlier versions of football, no player who was ahead of the ball on attack
could interfere with the play in any way. The new rule allowed such a player to
receive a kicked "forward pass" and even try a kick himself, so long as there
were at least three opponents between himself and the goal."
This actually predates the first international game which occurred between
England and Scotland in 1872 (http://www.ifhof.com/wn/history.asp). If you
don't consider that game "international," then perhaps, the first international
game occurred in 1904 between Belgium and France
As far as I can tell from several sites describing the history of international
soccer, there is no evidence that the offsides rule has not been present from
the beginning. It seems to have been an integral part of the game long before
international competition began despite ever-present controversies over the
interpretation of the rule.
For further reading on international soccer history see the above links and: