Let $\mu$ be a measure on the usual Borel sigma-algebra defined as $$\mu(A):=\int_A f\ d\lambda$$ where $\lambda$ denotes Lebesgue measure and $f$ is a non-negative measurable function. Now I want to show that for all non-negative functions $g:\mathbb{R}\to\mathbb{R}$ we have that $$\int g d\mu=\int f \cdot g\ d\lambda.$$
Attempt Suppose for $(a_i)_{i\in I}\subset\mathbb{R}$ we have $g=\sum_{i\in\mathbb{N}}a_{i}\mathbb{1}_{B_i}$ ( where $\mathbb{1}_{B_i}$ is the indicator function) with $B_i\in\mathscr{B}(\mathbb{R})$. Then $$\int g\ d\mu=\int \sum_{i\in\mathbb{N}}a_{i}\mathbb{1}_{B_i}\ d\mu=\sum_{i\in\mathbb{N}}a_{i}\mu(B_i),$$ but I really have no idea what I'm doing. Any suggestions and help is welcome.
It seems that you regard $A$ appearing in the definition of $\mu$ as a fixed set. But it means a generic measurable set and the proper definition would be $$ \mu(A) = \int_A fd\lambda, \quad\forall A\in\mathcal{B}. $$ Let us evaluate $\int gd\mu$ for simple $g = \sum_{i=1}^n a_i 1_{B_i}$. We have that $$ \int gd\mu = \int \sum_{i=1}^n a_i 1_{B_i}d\mu = \sum_{i=1}^n a_i\mu(B_i) = \sum_{i=1}^n a_i\int_{B_i} fd\lambda. $$ But we may write $\int_{B_i}fd\lambda = \int 1_{B_i}fd\lambda$. Hence we get $$ \sum_{i=1}^n a_i\int 1_{B_i}fd\lambda = \int \left(\sum_{i=1}^n a_i 1_{B_i}\right)fd\lambda = \int g\cdot fd\lambda. $$ So, it is clear that $\cdot$ is a product. We've shown $$ \int gd\mu = \int g\cdot fd\lambda $$ for any simple function $g$. If $g$ is a non-negative measurable function, then there is a non-decreasing sequence of non-negative simple functions converging to $g$. Monotone convergence theorem now implies that it is also true for any measurable $g\geq 0$.