The perfect infinitive means exactly what its name implies: it indicates the perfect tense in contexts when an infinitive is needed.

Your first sentence is fine: “I would like to have lived in the 13th century” is slightly different from “I would like to live in the 13th century”, but both mean basically the same thing. In the former, you are looking at things from the present, in which case a life spent in the 13th century is naturally already finished; hence the perfect tense. In the latter, you are looking at things from the ‘phrase-internal’ perspective of the 13th century, using a present tense. You can turn them both into finite clauses easily, and they are still both correct and perfectly normal sentences:

It would be nice if I lived in the 13th century
It would be [or have been] nice if I had lived in the 13th century

In your second phrase, though, the perfect infinitive does not make any sense—or at least, it requires quite a stretch of the imagination.

“She was going to have worked in her mother’s business” means that she was just on the verge of entering into a state where she had already worked in her mother’s business, but no longer did so. This might possibly make sense if she were currently working there and considering to quit, but it would be a very odd way of wording it. And with the rest of the phrase clearly indicating that she wasn’t actually working in her mother’s business at the time, it becomes an impossibility. The only viable option here is then:

She was going to work for her mother’s business, but decided instead to continue her studies.