Putting 了 in both parts of separable verbs: is it mandatory?
开始上了课 is not grammatical. 开始 means 'started', 上了课 means 'have finished class', You cannot "Started to have finished class"

A  grammatical sentence should be 我早上上课 (I attend classes in the morning) --> 我早上上了课 (I have attended classes in the morning)

And yes, you can insert 了 between the verb and noun in any separable verb to indicate it is completed action

Example:

看書 (read book) --> 看了書 (have read book)

吃飯 (eat meal) --> 吃了飯 (have eaten meal)

逃學 (skip classes) --> 逃了學 (have skipped classes)