He was a farmer at Salmon Gums before entering politics. Ainsworth was elected to the new Legislative Assembly seat of Roe at the 1989 election, and was re-elected in 1993, 1996 and 2001. He was the National Party spokesperson for Employment, Education and Training and Multicultural and Ethnic Affairs from March 1989 to November 1992, and the Coalition Shadow Minister for Employment and Training from November 1992 to February 1993 after the National Party re-entered its coalition with the Liberal Party.
He was not appointed to the ministry upon the election of the Court Coalition government at the 1993 election.
Ainsworth was Deputy Chairman of Committees from June 1993 to March 1998. He served on the Joint House Committee (1991-1993), the Joint Standing Committee on Delegated Legislation (1993-1994), and the Education and Health Standing Committee (2001-2005).
He retired at the 2005 election, at which his seat was lost to Liberal candidate Graham Jacobs.
He was a National Party of Western Australia member of the Western Australian Legislative Assembly from 1989 to 2005, representing the electorate of Roe. He also served as the chairman of the Select Committee on Road Safety (1993-1996), and as a member of the Select Committee on the Water Bill (1991-1992) and the Select Committee on Heritage Laws (1993-1995).