Obviously Rows[0][0] will give the first value.
If you want the Item[0] from last row, I think this will work :

SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString01"].ToString();
SqlCommand cmd = new SqlCommand("select cost_id from costomer",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
string temp = ds.Tables[0].Rows[ds.Tables[0].Rows.Count-1][0].ToString()
PS : You spell retreive incorrectly. Correct spelling is retrieve.