Reconfigurable intelligent surface (RIS) as an emerging cost-effective technology can enhance the spectrum-and energy-efficiency of wireless networks. In this paper, we consider an RIS-aided green edge inference system, where the inference tasks generated from resource-limited mobile devices (MDs) are uploaded to and cooperatively performed at multiple resourceenhanced base stations (BSs). Taking into account both the computation and uplink/downlink transmit power consumption, we formulate an overall network power consumption minimization problem, which calls for the joint design of the set of tasks performed by each BS, transmit and receive beamforming vectors of the BSs, transmit power of the MDs, and uplink/downlink phase-shift matrices at the RIS. Such a problem is a mixed combinatorial optimization problem with nonconvex constraints and is highly intractable. To address the challenge of the combinatorial objective, a group sparse reformulation is proposed by exploiting the group sparsity structure of the beamforming vectors, while a block-structured optimization (BSO) approach is proposed to decouple the optimization variables. Finally, we propose a BSO with mixed 1,2-norm and difference-of-convex-functions (DC) based three-stage framework to solve the problem, where the mixed 1,2-norm is adopted to induce the group sparsity of beamforming vectors and DC is adopted to effectively handle the nonconvex rank-one constraint after matrix lifting. Numerical results demonstrate the supreme gain of deploying an RIS and confirm the effectiveness of the proposed algorithm over the baseline algorithms.Index Terms-Reconfigurable intelligent surface, joint uplink and downlink, green edge inference, block-structured optimization, mixed 1,2-norm,