Coworker is pregnant

Lucy

My coworker is pregnant and she’s had her risk assessment and she’s basically been given my job which means I’m not necessary. Is it against the law to do this? Is it discrimination because I’m not pregnant? She was on a higher wage before and she’ll still get paid that for doing my job?