The phrase 'Working on it " is a so called verbal ( or gerund) phrase and it functions as the subject of the sentence.
Working on it ( verbal phrase functioning as SUBJECT)
had begun ( predicate)
A GERUND phrase will begin with a gerund, an "ing word " ( in this example 'working') and might include other modifiers and/or objects. Gerund phrases always function as nouns, so they will be subjects or subject complements.
Another example to show how this sentence is built :
" Eating ice cream on a windy day can be a messy experience if you have long, untamed hair."
"Eating ice cream on a windy day ' is the gerund phrase , starting with the verbal noun 'eating', it functions as the subject of the sentence ,then comes the predicate "can be " and the object ' a messy experience".