If an artificial intelligence was smart enough to handle all business activity and affairs could it be given ownership of a company?
No. An AI cannot own a company.
Artificial intelligences are not legal persons. The law recognizes human beings and legally recognized entities as persons. It does not recognize AIs or for that matter non-human species as persons except in a handful of jurisdictions that recognize, for example, some select rivers as legal persons (e.g. New Zealand).
Something close would be possible, however.
It is possible to establish a non-profit corporation without owners, or to establish a non-profit entity that is not a corporation (often called a "foundation") that has no owners. These entities are required to have humans who serve on a board of directors. But, the nonprofit entity or foundation could have bylaws that delegate decision making responsibility on all or many matters to an AI, in much the way that decision making responsibility of all or many matters might be delegated to the CEO of a nonprofit corporation.
While the AI can't own anything and indeed, to the contrary, would be owned by the entity, the AI's actions could cause the entity to earn income, to acquire and dispose of property, and to participate in lawsuits. And, while most non-profit entities and foundations are designed to have charitable purposes in order to garner tax benefits, there are many kinds of non-profits that exist for non-charitable purposes (e.g. country clubs, stock exchanges, HOAs and political organizations).
If an AI was vested with management of most key parts of an entity's operations, that entity had no owners, and its board of directors was relatively docile, this would come reasonably close, in practice, to what an AI owned entity would look like.
How The Law Could Be Changed
Indeed, one plausible form of organization for the AI would be as a political organization which could be devoted to the purpose of reforming the law to give AIs personhood status. If one U.S. state did so, for example, this would allow all AIs to use that state's law to form entities owned by them, that could operate in any U.S. state, since geographic constraints do not really apply to AIs. And, it doesn't take that much money to lobby a single state to adopt a law if there is no obvious constituency to oppose the adoption of the law.
Analogous Historical Precedents
There are deep historical precedents for allowing people who were not legally allowed to own property to manage businesses.
In the Roman Empire, the practice of having a slave operate a business or venture or transaction as an agent of the slave's owner was well recognized. This was also true, to a much narrower extent and much less frequently, under American chattel slavery.
In the medieval and early modern era in Europe and in the post-colonial regimes in the Americas, it was not uncommon in jurisdictions that did nt otherwise recognize the right of a married woman to own property or to be recognized as a legal person in a court to be allowed to manage her husband's affairs on his behalf in his absence as his delegate agent to do so (often for long periods of time, for example, when the husband was away at war, and for entire fiefdoms for which the aristocratic husband was the lord).
European law also recognized the concept that when a royal or noble title was inherited by an oldest son due to the death of his father, when the son was just a child, that the mother could serve a regent for the son and manage the affairs of the jurisdiction associated with the son's title, even though the mother was not legally permitted to hold that title in her own right.
For that to happen, a law needs to pass that will recognise AIs meeting certain criteria to be legal persons, or a judge needs to be convinced to recognise them as such.
It will probably happen at some point, but still a long way to go.