Let 'x' be the amount invested at 7%
'y' be the amount invested at 6%
--------------------
Since the total amount is 5,000 then you'll have it as:
x + y = 5,000 ----equation 1
-------------------
Since the amount invested will have an interest of 332 at the end of one year then:
0.07x + 0.06y = 332
-------------------
From equation 1:
x + y = 5,000
x = 5,000 - y ----equation 1'
-------------------
Substitute equation 1' to equation 2
0.07x + 0.06y = 332
0.07(5,000-y) + 0.06y = 332
350 - 0.07y + 0.06y = 332
- 0.07y + 0.06y = 332 - 350
-0.01y = 18
y = 1,800
------------------
Substitute y=1,800 to equation 1'
x = 5,000 - 1,800
x = 3,200
-----------------
Therefore 1,800 was invested at 6% and 3,200 was invested at 7%