Amelia purchased 1 t-shirt and 2 baseball caps, spending a total of $86. Her Cody purchased 4 t-shirts and 2 baseball caps, which cost him a total of $158. Assuming that all of the t-shirts and all of the caps are the same price, what is the price of each?

Let's assume the price of a t-shirt is x and the price of a baseball cap is y.

According to the given information, Amelia purchased 1 t-shirt and 2 baseball caps, which cost her 1*x + 2*y = $86.
Similarly, Cody purchased 4 t-shirts and 2 baseball caps, which cost him 4*x + 2*y = $158.
Simplifying the first equation, we get x + 2y = 86 ---(1).
Simplifying the second equation, we get 4x + 2y = 158 ---(2).
Subtracting equation (1) from equation (2), we get (4x + 2y) - (x + 2y) = 158 - 86.
Simplifying, we get 3x = 72.
Dividing both sides by 3, we get x = 24.
Substituting x = 24 in equation (1), we get 24 + 2y = 86.
Subtracting 24 from both sides, we get 2y = 62.
Dividing both sides by 2, we get y = 31.
Therefore, the price of each t-shirt is $24 and the price of each baseball cap is $31. Answer: \boxed{24, 31}.